0

I have disabled a few functions using disable_functions in php.ini. On calling these functions I can see in my logs that a warning is generated like:

PHP Warning: somefunction() has been disabled for security reasons in file

However the rest of the file is executed normally.

Is there any way to block the execution (or exit code) once a disabled_function is called. Something like a callback function maybe?

Or else is it possible to turn that Warning into an Error?

PHP version PHP 5.5.12-2ubuntu4.3

shivam
  • 16,048
  • 3
  • 56
  • 71
  • possible dupe: http://stackoverflow.com/q/2749591/3933332 – Rizier123 Mar 24 '15 at 13:33
  • 3
    http://stackoverflow.com/questions/7050067/how-to-make-php-exit-on-e-notice – Steve Mar 24 '15 at 13:33
  • @Steve thanks for the link. Looks pretty much close to what I want. – shivam Mar 24 '15 at 13:35
  • `disable_functions` will effectively *disable* the functions listed. Meaning they will not be available anymore in PHP. If your script *works* as expected, then these functions are called in conditional blocks which does not get executed during your test, otherwise it would throw a fatal error and exit immediately. – hek2mgl Mar 24 '15 at 13:37
  • @hek2mgl thats what I desired. However cause of some reason its not throwing error, instead its given a detailed warning as posted in my question. – shivam Mar 24 '15 at 13:40

0 Answers0