Hi, I'm trying to replace the LuCI page with a custom PHP web page.
As a noob:
I installed php7
renamed /www/index.html (with the redirection to LuCI inside?) in luci.html
insert my PHP page with all the relative folders inside /www
and finally reboot hoping everything worked at this first rough attempt.
Obviously it does not work: the browser displays the contents of the /www folder but clicking index.php the page does not open instead the download of the page starts.
What are the best practices for doing this?
what needs to be changed in the configuration files?
what additional software is needed?
I thank you for your help and I hope this answer can also be useful to other users.
thank you so much! it is a world full of hate and pain!
I write below the dirty procedure, maybe someone could come in handy:
install the things you need:
opkg install php7 php7-cgi php7-mod-session php7-mod-json
In my case i need json stuff
upload the site and all its stuff into /www, modify/rename/delete pre-existing index.html, what makes LuCI open
open /etc/php.ini and verify that "doc_root" is empty, otherwise empty it
open /etc/config/uhttpd and insert/modify "option index_page index.php" so that it loads the PHP page (otherwise it opens the index.html)
and activate PHP by uncommenting:
list interpreter ".php = / usr / bin / php-cgi"
restart the /etc/init.d/uhttpd restart service or the whole device