How to remove error "Warning: ini_set() has been disabled for security reasons", *without* enabling ini_set?

5,479

You can disable showing of PHP warnings, either in server main php.ini or custom php.ini on the account.

edit /usr/local/lib/php.ini, and change error_reporting value to following, to not show notices and warnings.

error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING

if you want do it by custom php.ini on the account, copy the main php.ini to user folder and edit that file.

cp /usr/local/lib/php.ini /home/$user/public_html/php.ini 

and then edit that file, and change error_reporting

Share:
5,479

Related videos on Youtube

superuser
Author by

superuser

Updated on September 18, 2022

Comments

  • superuser
    superuser over 1 year

    I don't want to turn on ini_set() for security reasons. So per CSF's recommendation, I did add it to be unset.

    However, a drupal site gives this error, but I want to remove the error (or hide it) without actually enabling ini_set().

  • superuser
    superuser over 9 years
    it worked for that error. But it's still showing a different PHP warning. But I;ll accept since it answered the quesiton. Thank you!
  • superuser
    superuser over 9 years
    update: this solved the problem; the other errors were fixed by restoring another sql backup.
  • Ligemer
    Ligemer over 9 years
    I would like to know if PHP has any plans to suppress certain errors like this only. I would like to disable only this warning, but not others. Might be able to create a custom error handler that would do this too but it would be interesting to see if PHP can support it natively.