matley Posted October 19, 2009 Share Posted October 19, 2009 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 More sharing options...
Alt_F4 Posted October 20, 2009 Share Posted October 20, 2009 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) 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 :-\ Link to comment https://forums.phpfreaks.com/topic/178227-cant-shake-the-warning-include-error/#findComment-940246 Share on other sites More sharing options...
Mchl Posted October 20, 2009 Share Posted October 20, 2009 Check for safe_mode using phpinfo. This will also tell you, if you were looking in correct php.ini file ('Loaded Configuration File') Link to comment https://forums.phpfreaks.com/topic/178227-cant-shake-the-warning-include-error/#findComment-940255 Share on other sites More sharing options...
matley Posted October 20, 2009 Author Share Posted October 20, 2009 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 Link to comment https://forums.phpfreaks.com/topic/178227-cant-shake-the-warning-include-error/#findComment-940495 Share on other sites More sharing options...
redarrow Posted October 20, 2009 Share Posted October 20, 2009 It must be the structure of the new current host files ask? Link to comment https://forums.phpfreaks.com/topic/178227-cant-shake-the-warning-include-error/#findComment-940502 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.