views:

45

answers:

2

Even though I've set

safe_mode = Off

in php.ini, restarted apache, and even rebooted the system...

when I try to execute set_time_limit(0) in my application, it throws the warning that set_time_limit cannot be st in safe mode.

This has been erratic behavior; earlier when I set safe_mode to Off, the system worked fine. But later on, seemingly autonomously, safe_mode has returned, and my application breaks due to the time_limit.

Is there anything I can check? I fear that my system has been compromised.

+1  A: 

PHP settings can appear in a number of different locations - it's likely that the setting in php.ini is being overridden by a setting elsewhere.

You might want to check:

  • Your Apache configuration, such as httpd.conf/apache.conf or virtual host configuration.
  • An .htaccess file

Given that phpinfo is talking about a "Local setting" that sounds a little bit like a .htaccess setting to me but it could be in another part of Apache's config.

It's not usual for PHP to be placed in safe mode on a 'default install', indeed it will be deprecated in future PHP versions if it isn't already. It's strange then that you have safe mode enabled without knowing it - perhaps some other app enabled it as part of its install script or maybe you copy-pasted some example configuration from somewhere? I dunno.

thomasrutter
I believe Plesk is over-riding my php.ini settings, but i do not know how to over-ride this.
Try this then: http://www.nickhammond.com/2008/04/20/turning-off-php-safe-mode-with-plesk/
thomasrutter
Thank you Thomas, this was the answer.
A: 

If you're running XAMPP, then the correct php.ini file is located at xampp\apache\bin\php.ini. Modifying xampp\php\php.ini won't affect anything.

(Paths may differ between OSes, this is for Windows).

TheMagician