I get the following error, each time I try to run a .php file: Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5 with Suhosin-Patch Server at Port 80

Asked by Mordeki_Rebel on 2008-07-05

Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5 with Suhosin-Patch Server at Port 80

I get this error each time i use firefox to look at my .php files. I just installed LAMP.

Question information

English Edit question
Ubuntu apache2 Edit question
No assignee Edit question
Solved by:
marcobra (Marco Braida)
Last query:
Last reply:

Please tell better what are you trying to do...
This isn't an error message...

Thank you

Mordeki_Rebel (abrutus) said : #2

I loaded the server version of Ubuntu (Hardy Heron). I installed the LAMP Feature. Then a wrote a simple Hello World .php file to run using firefox. The file is located inthe /var/www folder. I have tried to use the following URLs to run the file:
1. ERROR = warning: Unknown: failed to open stream:Permission denied in Unknown on line 0; Fatal Error:Unknown: Failed opening required '/var/www/HelloWorld.php' (include_path='.:/usr/shar/php:/usr/share/pear') in Unknown on line 0
2. http://localhost/HelloWorld.php ERROR = same error as before
3. http://var/www/HelloWorld.php ERROR = Thre reuqested UL //www/HelloWorld.php was
not found on this server

some time I get the error:
Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5 with Suhosin-Patch Server at Port 80

what am I doing wrong?

I think may be your file permission or owner. Can you copy and paste the result of the :

ls -l /var/www

command here.

Try to change owner of the file it may be same of Apache owner usually www-data

sudo chown www-data.www-data /var/www/HelloWorld.php

Hope this helps

Mordeki_Rebel (abrutus) said : #4

Thank you for your assistance. This did not solve my problem. I reloaded the server version of Ubuntu (Hardy Heron), ran the updates and then ran the php file.

Then I got the following error: include_path='.:/usr/share/php:/usr/share/pear'

So I used the following to install the php-db package:

apt-get install php-db

This did not solve the issue as I continued to get the 'include' error. I checked the file permissions and set 'others' to read & write.

To install from terminal you must use sudo, so please type:

sudo apt-get install php-db php-pear

Then try to check your include paths and the /etc/php5/apache2/php.ini settings (set logging on in this file) try to discover error and warning into your
/var/log/apache2/ files and/or checking into /var/log/syslog

Can you put the contents of your /var/www/HelloWorld.php here.

Thank you.

Hans (hans66) said : #6

I had same problem. Culprit was a too strict apparmor profile for apache