Omega 2+ PHP install problem [RESOLVED]
-
Onioneers,
I'm trying to install php on my omega 2+.First I ran opkg update and got
Downloading http://downloads.lede-project.org/snapshots/targets/ramips/mt7688/packages/Packages.gz.
Updated list of available packages in /var/opkg-lists/reboot_core.
Downloading http://downloads.lede-project.org/snapshots/targets/ramips/mt7688/packages/Packages.sig.
Signature check passed.
Downloading http://downloads.lede-project.org/snapshots/packages/mipsel_24kc/base/Packages.gz.
Updated list of available packages in /var/opkg-lists/reboot_base.
Downloading http://downloads.lede-project.org/snapshots/packages/mipsel_24kc/base/Packages.sig.
Signature check passed.
Downloading http://repo.onion.io/omega2/packages/Packages.gz.
Updated list of available packages in /var/opkg-lists/reboot_onion.
Downloading http://repo.onion.io/omega2/packages/Packages.sig.
Signature check passed.
Downloading http://downloads.lede-project.org/snapshots/packages/mipsel_24kc/packages/Packages.gz.
Updated list of available packages in /var/opkg-lists/reboot_packages.
Downloading http://downloads.lede-project.org/snapshots/packages/mipsel_24kc/packages/Packages.sig.
Signature check passed.Then I ran opkg install php5 php5-cgi and got
Unknown package 'php5'.
Unknown package 'php5-cgi'.
Collected errors:- opkg_install_cmd: Cannot install package php5.
- opkg_install_cmd: Cannot install package php5-cgi.
What am i doing wrong?
-
Exploring /etc/opkg/distfeeds.conf i found php7 package only, so i tried
opkg install php7 php7-cgi
And done
Then i followed this topic https://community.onion.io/topic/669/php-functions to install php, but looks like omega 2 isn't interpreting php (when i access the url on omega, browser download the file index.php)
-
Well, I found the problem,
When editing..
vi /etc/config/uhttpd
Use these lines
list interpreter ".php=/usr/bin/php-cgi" option index_page 'index.php'
Now it's working
-
@Caio-Reimann probab you could add
index.php, index.html, index.htm
so you could use php statments in a html page to?
-
I don't think so Luciano because php interpret the code with file extension ".php", but you can use html code in php pages.
Using your code is a good ideia when you want to uhttpd search for one of these files automatic, when you don't tell the specific file you want, like http://localhost/php/
If you would like to try, for example, save this text in index.php
<html> <head> <title>This is Hello World using HTML codes inside a php page</title> <script> alert("Hello World in JS"); </script> </head> <body> <?php echo "<h1>Hello World</h1>" ?> <table style="border: 1px solid"> <tr> <td><?php echo "Hello World in a table" ?></td> </tr> </table> </body> </html>
So, you can use HTML, CSS and JS in a PHP page.
-
@Caio-Reimann thanks!
-
This post is deleted!