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

DavidPostill
  • 153,128
  • 77
  • 353
  • 394
superuser
  • 3,428
  • 7
  • 25
  • 40

1 Answers1

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

ralz
  • 2,490
  • 20
  • 16
  • 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 '14 at 04:33
  • update: this solved the problem; the other errors were fixed by restoring another sql backup. – superuser Oct 30 '14 at 01: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 '14 at 20:30