apache2 - 403 - Forbidden error only with PHP serverwide, Raspberry Pi -


it first question here. 403 - forbidden every php file. tried index.php , other names test.php. tried different subfolders , in /var/www/html directly.

raspberry pi 2 model b rev 1.1     server version: apache/2.4.10 (raspbian) server built:   jul 18 2017 22:21:17 

all updates installed. have owncloud, pihole, mysql installed. worked fine , after restart stopped working , more restarts don't fix it. had fix network issues 'no route host' , new external hdd.

i set permissions

sudo find /var/www -type d -exec chmod 755 {} + sudo find /var/www -type f -exec chmod 644 {} + 

so folders 755 , files 644. owner www-data:www-data everywhere in /var/www

so th structure index.php example be

drwxr-xr-x  12 root root  4096 may  4 05:01 var     drwxr-xr-x  4 root root       4096 jul 25 20:47 www drwxr-xr-x  6 www-data www-data 4096 jul 25 19:52 html -rw-r--r--  1 www-data www-data    29 jul 24 20:08 index.php 

also tried chmod 777 on index.php still 403 error.

index.php:

<?php echo "hello world"; ?> 

or

<?php phpinfo(); ?> 

both don't work. no .htaccess files used.

part of apache2.conf:

<directory />         options followsymlinks         allowoverride none         require denied </directory>  <directory /usr/share>         allowoverride none         require granted </directory>  <directory /var/www/>         options indexes followsymlinks         allowoverride none         require granted </directory> <directory /var/www/html>         order allow,deny         allow         require granted </directory> 

added last directory in attempt fix it.

so causing error?

so decided purge , configs plus folders. after reinstalling realized migth

drwxr-xr-x  4 root root       4096 jul 25 20:47 www 

needed

drwxr-xr-x  4 www-data www-data       4096 jul 25 20:47 www 

owned www-data www-data because is. don't understand how can index.html work in folders , php not.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -