I"m using a Raspberry Pi 3.
You need:
1, install Apache and PHP
2, install Athlon1600/php-proxy-app
3, port forwarding on your modem / router
4, use HTTPS (optional)
5, use dynamic DNS (optional)
1, install Apache and PHP
https://www.stewright.me/2016/03/turn-raspberry-pi-3-php-7-powered-web-server
Step 1 – Add new repository sources
At the time of writing, PHP 7.0 hasn’t yet made the official repository sources, so we need to add one which provides us with the PHP 7.0 packages. Edit your sources file with this command:
Below the existing entries in the file on a blank line, add the following two lines:
Your file should look a little like this:
Next we need to add a couple of certificates in order to allow us to use the sources with apt-get. Run the following two commands:
And finally we need to update the package list by running:
Step 2 – Install the core Apache2 and PHP 7 packages
We’re ready to install Apache2 and PHP7, along with some common packages that we may need for most web applications such as Symfony2, WordPress, Drupal etc. Run the following command to install these packages:
This may take a little time, but as soon as we’re done, we are essentially finished.
Step 3 – Test Apache2 and PHP 7
Assuming all went well, we’re ready to test to see if everything went OK with the installation. First we’ll test the version of PHP that CLI is using:
You should see something like this:
Next we’ll test two things; Apache2 and PHP 7. In your web browser, visit the IP address of your Raspberry Pi. If you haven’t used ssh and have followed these steps on your Raspberry Pi 3 itself, just visit http://127.0.0.1, otherwise change 127.0.0.1 for the IP address of your Raspberry Pi.
You should see the default Debian holding page:
Next we’ll test PHP. Run the following command to create a test file:
Yet again, visit the IP address of your Raspberry Pi, this time adding /phpinfo.php to the URL. You should see the PHP Information.
Tips: if you got error of cUrl extension not installed, you can do:
sudo apt-get install php-curl
sudo service apache2 restart
reference: https://stackoverflow.com/questions/33775897/how-do-i-install-the-ext-curl-extension-with-php-7?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa2, install Athlon1600/php-proxy-app
https://github.com/Athlon1600/php-proxy-app
3, port forwarding on your modem / router
https://maker.pro/raspberry-pi/projects/raspberry-pi-web-server
4, use HTTPS (optional)
https://variax.wordpress.com/2017/03/18/adding-https-to-the-raspberry-pi-apache-web-server/comment-page-1/
5, use dynamic DNS (optional)
https://desec.io/#!/en/docs/dyndns-client#option2
No comments:
Post a Comment