开发者

How to force error_reporting mode in PHP 5.3

开发者 https://www.devze.com 2023-01-19 04:37 出处:网络
I have some c开发者_StackOverflow中文版ode that\'s encrypted with ioncube and it\'s also written for < PHP 5.3. There\'s a ton of deprecated code, which would still work, but there\'s error message

I have some c开发者_StackOverflow中文版ode that's encrypted with ioncube and it's also written for < PHP 5.3. There's a ton of deprecated code, which would still work, but there's error messages all over the site.

Is there a way of externally forcing error_reporting to E_ALL ^ E_DEPRECATED or similar? I'm sure in the code they're hardcoding to E_ALL for some reason.


Disable display_errors and log them to a file instead. That is standard procedure for any production web site.

In an Apache config file, php_admin_value error_reporting X should make it impossible to be overridden by user code, where X is the integer value you want.

Also, set_error_handler() might be of use if you want to do some runtime checks.


Rolled back to PHP 5.2 and avoided the problem.

0

精彩评论

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