Three reasons I'm guessing
First:
You may not have privileges/permissions to access the file your trying to include.
Usually, this is the very error involved with failed include statements.
Try running this code:
<?php
var_dump(substr(sprintf('%o', fileperms('/include/libs.php')), -4));
?>
If the last three digits of output are less than 7, 5 and 5 respectively then you're caught up in a file permission problem.
You can resolve this error by changing the including file(s) permissions in bash
sudo chmod -R 0755 /var/www/include/libs.php
Use sudo chmod 0755 /var/www/html/include/libs.php
instead, if, your apache version is above 2.4
Note that you need to use the -R
flag for chmod so that all your enclosing folders are also chmodded.
Second:
You are not running php as the default apache2 user-group OR your includee file belongs to root.
This, like the previous reason is also file permission exception.
run
sudo chown "www-data" /var/www/include/libs.php
OR
sudo chgrp "www-data" /var/www/include/libs.php
followed by sudo service apache2 restart
in bash.
Third:
You may have screwed your apache2/PHP installation/configuration settings.
Hit sudo apt-get purge php5
and the sudo apt-get install php5
in bash.
Keep in mind that his WILL burn all your custom php.ini
settings and you may need to start configuring right from the beginning. [ I learned this the hard way :D ].
Hope this helps ...
UPDATE:
After i read that there is no error shown,
it occurred to me you have the default php5 config ...
open sudo gedit /etc/php5/apache2/php.ini
Change the line display_errors = Off
to display_errors = On
This was the problem I had when I installed php from scratch ...