Jump to content

Can't shake the "Warning: include()" error


matley

Recommended Posts

I've just uploaded my site to a new server and where I have PHP include tags in my HTML, the browser reads:

 

"Warning: include() [function.include]: SAFE MODE Restriction in effect. The script whose uid is 500 is not allowed to access ../header.php owned by uid 0 in....."

 

It seems to be for every include tag which has the address starting from the root directory. For example "/images/pirate.php". I'm not a programming master but I've checked the PHP.ini file and SAFE MODE is turned off. What else could this be?

Link to comment
https://forums.phpfreaks.com/topic/178227-cant-shake-the-warning-include-error/
Share on other sites

a quick google came up with these (i haven't tried them myself so just make sure you backup the file before you change it)  :D

 

in /etc/httpd/conf/httpd.conf:

<IfDefine vwh_php4_module>

php_admin_flag safe_mode on

</IfDefine>

 

 

make an .htaccess file, then on the first line put the following.

php_value register_globals 0

 

 

Administrator should put this to php.ini:

safe_mode_include_dir = /usr/lib/php

 

these may not work but worth a shot i guess  :-\

well those don't seem to work. I get the feeling I need to amend the php.ini file in the "Paths and Directories" section.

 

If this is any further help, the complete error messages I get for each inclusion is something like this one I got for my header.php:

 

Warning: include() [function.include]: SAFE MODE Restriction in effect. The script whose uid is 500 is not allowed to access ../header.php owned by uid 0 in /var/www/dan/data/www/murraylinks.co.uk/new2/jobs/index.php on line 45

Warning: include(../header.php) [function.include]: failed to open stream: No such file or directory in /var/www/dan/data/www/murraylinks.co.uk/new2/jobs/index.php on line 45

Warning: include() [function.include]: Failed opening '../header.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/dan/data/www/murraylinks.co.uk/new2/jobs/index.php on line 45

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.