1

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

1 Answer 1

1

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

3
  • 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
    Oct 29, 2014 at 4:33
  • update: this solved the problem; the other errors were fixed by restoring another sql backup.
    – superuser
    Oct 30, 2014 at 1:10
  • 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.
    – akahunahi
    Nov 18, 2014 at 20:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .