I just installed apache2, php, mysql, phpmyadmin, and vftpd (to add files via filezilla) on my raspberry pi, which is used as a local web server.
I created a simple index.php page with Brackets (a php file editor). I uploaded it to the /var/www/index
directory, but when I go open a web browser, the file is a white page! It seems it doesn't recognize the php file.
However php is working well, because I create this file via the terminal (Mac) to be sure php was activated : echo "<?php phpinfo(); ?>" > /var/www/index.php
When I add an html file it shows me that:
pi@192:~ $ ls -la /var/www/
total 16
drwxr-xr-x 3 pi root 4096 nov. 29 16:56 .
drwxr-xr-x 12 root root 4096 nov. 29 15:32 ..
-rw-r--r-- 1 pi pi 126 nov. 29 16:41 essay.php
drwxr-xr-x 2 pi root 4096 nov. 29 16:56 html
pi@192:~ $ tail /var/log/apache2/access.log
192.168.1.76 - - [29/Nov/2015:16:43:59 +0100] "GET / HTTP/1.1" 200 23783 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7"
192.168.1.76 - - [29/Nov/2015:16:44:03 +0100] "GET / HTTP/1.1" 200 23783 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7"
192.168.1.76 - - [29/Nov/2015:16:44:04 +0100] "GET /mysql.php HTTP/1.1" 404 505 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7"
192.168.1.76 - - [29/Nov/2015:16:44:05 +0100] "GET /mysql.php HTTP/1.1" 404 506 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7"
192.168.1.76 - - [29/Nov/2015:16:44:09 +0100] "GET /lol.php HTTP/1.1" 500 187 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7"
192.168.1.76 - - [29/Nov/2015:16:44:10 +0100] "GET /lol.php HTTP/1.1" 500 187 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7"
192.168.1.76 - - [29/Nov/2015:16:45:15 +0100] "GET / HTTP/1.1" 200 23782 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7"
192.168.1.76 - - [29/Nov/2015:16:56:32 +0100] "GET / HTTP/1.1" 403 518 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7"
192.168.1.76 - - [29/Nov/2015:16:56:33 +0100] "GET /index.php HTTP/1.1" 200 23788 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7"
192.168.1.76 - - [29/Nov/2015:16:56:36 +0100] "GET /index.html HTTP/1.1" 403 518 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7"
pi@192:~ $ ls -la /var/www/html/
total 24
drwxr-xr-x 2 pi root 4096 nov. 29 17:05 .
drwxr-xr-x 3 pi root 4096 nov. 29 17:09 ..
-rw-r--r-- 1 pi pi 20 nov. 29 16:13 index.php
-rw------- 1 pi pi 31 nov. 29 16:23 lol.php
-rw-r--r-- 1 pi pi 178 nov. 29 16:35 mysql.php
-rw------- 1 pi pi 19 nov. 29 16:20 start.php
I used this tutorial
/var/log
, dunno where :)