How can I set index.php priority instead of html files ?
I tried to set in the /etc/config/uhttpd file the "option index_page" or "option index_file" as described here: Web Server Configuration (uHTTPd) [Old OpenWrt Wiki].
After saving changes, i always did a utttpd restart but no one solution worked...
Hi, another time here because my old problem become my new problem...the situation:
/www folder is like original, with the index.html that works properly with the yun control page (I can connect using http://yun.ip/)
/www/keystore_manager_example/ have a index.html that doesn't work (I can't connect using http://yun.ip/keystore_manager_example but I can by adding /index.html)
/www/sd/ have a index.php that works properly (I can connect using http://yun.ip/sd/)
the uhttpd config:
# Index file to use for directories, e.g. add index.php when using php
list index_page 'index.html'
list index_page 'index.php'
the command uci show uhttpd tells me:
uhttpd.main.index_page=index.html index.php
Why the index.html in the dir keystore_manager_example doesn't work ?
index_file file name no index.html, index.htm, default.html, default.htm Index file to use for directories, e.g. add index.php when using php
index_page file name no index.html Index file to use for directories, e.g. add index.php when using php (last, 20131015, replace index_file ?) should be noted: list index_page "index.html"
and if I put in my config file:
# Index file to use for directories, e.g. add index.php when using php
option index_page 'index.html'
option index_page 'index.php'
the command uci show uhttpd tells me:
uhttpd.main.index_page=index.html index.php
infact i have a index**.php** in /sd that works! and the index**.html** in the /www that works also...the only one that doesn't work is the index.html in the /keystore_manager_example dir
http://yun.ip/keystore_manager_example/ ==> DOESN'T open the index.html file !! It returns the error "No such file or directory" ... I have to manually write:
Maybe too late but for everyone, I have The same problem and fix it.
If you need in webserver "uhttpd" run together html and php index
Here is oficial man: Web Server Configuration (uHTTPd) [Old OpenWrt Wiki] Speed tutorial:
Must install PHP5:
opkg update
opkg install php5 php5-cgi
Must edit uhttpd config file
vi /etc/config/uhttpd
now must add 3 rows (lines)[without number & colon]:
1:list interpreter '.php=/usr/bin/php-cgi'
2:list index_page 'index.html, default.html, index.php'
3:option index_file 'index.html, default.html, index.php'
And now just only restart uhttpd server:
/etc/init.d/uhttpd restart
If you want can you control it:
uci show uhttpd
When you will see in uci list this 3 lines as: uhttpd.main.interpreter='.php=/usr/bin/php-cgi' uhttpd.main.index_page='index.html, default.html, index.php' uhttpd.main.index_file='index.html, default.html, index.php'