1

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.

user373396
  • 100
  • 1
  • 1
  • 6
  • 2
    Does `phpinfo()` show safe mode being disabled? Maybe you changed the wrong configuration file, or the change was not saved because of a permission problem, etc.etc. Also, what OS and version of PHP are you using? – cbednarski Aug 13 '10 at 01:44
  • I am using fedora redhat 7, PHP 5.2.6 phpinfo says that there is a "Local Setting" which is "On", vs. a Master Setting, which is "Off". – user373396 Aug 13 '10 at 01:48

2 Answers2

1

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
  • 114,488
  • 30
  • 148
  • 167
0

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
  • 1,846
  • 7
  • 20
  • 26