I'm trying to open a simple text file on my raspberry pi using PhP. This is the code:
<html> <body> <?php $myfile = fopen("/home/pi/Desktop/hello.txt", "r") or die("Unable to open file!"); echo fread($myfile,filesize("/home/pi/Desktop/hello.txt")); fclose($myfile); </body> </html>
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