1

After I installed apache2 and ran it, the default HTML page of apache2 works fine. Then I installed PHP 5.6 and restarted apache2 and created PHP file in /var/www/html called info.php and put <?php echo 'hello word!' ; ?> in it and ran it on Firefox. As the result it says forbidden, I have tried to change the permission for www directory and it gave me the same error.

4
  • Post the output of ll /var/www/html/info.php
    – storm
    Apr 4, 2016 at 15:22
  • -rwxr-xr-x 1 www-data www-data 52 Apr 2 14:32 /var/www/html/info.php* this is it. Apr 4, 2016 at 15:51
  • What does the Apache error logs show are the actual cause for the 403?
    – Thomas Ward
    Apr 4, 2016 at 16:01
  • the error log file is empty. Apr 4, 2016 at 16:07

1 Answer 1

1

in /etc/apache2/apache2.conf add Require all granted to the directories you want to grant access to like this

<Directory "your directory here">
   Order allow,deny
   Allow from all
   Require all granted
</Directory>

Then restart apache2 service and go to http://localhost/info.php .

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .