I agree with MartinMarty in my experience using apache..the original file by default was /var/www/html. After downloading PHP I had to change the HTML to PHP. I did this by typing
Sudo nano /var/www/php5 I then added some simple PHP code to show the date saved the file usomg control x Y Enter Then from the terminal I had to remove /var/www/HTMl I then type ls to verify it is gone revisit the ip address hit refresh and you should see the date and the file will be php
I hope this helps..it worked for me
manpreet
Best Answer
2 years ago
I'm trying to open a simple text file on my raspberry pi using PhP. This is the code:
I saved the above code as .php and opened it on the web browser by typing the raspberry pi IP address and the file name i.e. 192.168.0.17/hi.php yet the web browser is saying "Not Found". I also installed
sudo apt-get install apache2 php5
,sudo apt-get install lighttpd php5
,sudo apt-get install git-core
, and cloned the Wiring PI.Can some one tell me if I'm doing anything wrong please? Thanks