Install PHP on Raspberry Pi - ajumalp/rpi-nas GitHub Wiki
sudo apt -y install php libapache2-mod-php
- To check PHP is installed properly, we need to add a file, index.PHP in
/var/www/html/
folder
- To add this file, first move to this folder with below command
cd /var/www/html/
sudo nano index.php
- Now type the below sample php data and save the file
<?php echo "This is a test message"; ?>
- Hit
Ctrl+X
on keyboard to save the file and press enter key
- To test PHP installation, open
http://<rpi ip address>/index.php
on browser
- In my case it is,
http://piserver/index.php
- You will notice the above message
This is a test message
which means, you have installed php successfully