Apache server does not execute .php files [closed]

Posted on

Question :

I just installed Apache and PHP in my linux, and all my .php files are showing this following error log:

  

[Sat Mar 07 12:10:48 2015] [error] [client :: 1] PHP Warning: Unknown:
  failed to open stream: Permission denied in Unknown on line 0 [Sat Mar
  07 12:10:48 2015] [error] [client :: 1] PHP Fatal error: Unknown:
  Failed opening required ‘/var/www/index.php’
  (include_path = ‘.: / usr / share / php: / usr / share / pear’) in Unknown on line 0

Inside this file has only this:

<?php
   phpinfo();
?>

The distro that I use is debian, I installed apache, php and mysql with the following command:

sudo apt-get install apache2 php5 libapache2-mod-php5 mysql-server

    

Answer :

These files probably do not have the necessary permissions.

At the terminal type:

sudo chmod -R 755 ~/var/www/

This will allow you to read and execute the files in the /var/www/ folder.

    

Leave a Reply

Your email address will not be published. Required fields are marked *