开发者

PHP stuck in safe_mode

开发者 https://www.devze.com 2023-01-11 14:53 出处:网络
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_l

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 anyth开发者_如何转开发ing I can check? I fear that my system has been compromised.


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.


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消