3

I have a site using Drupal 6; after upgrading PHP to 5.4 , some strict warning appear.

I set error_reporoting in settings.php with the following code, but I still see the E_STRICT warnings.

error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_WARNING);
ini_set('display_errors', TRUE);

Why do I still see them? What can I do to avoid seeing them?

  • what warning do you see? can you show it? – xurshid29 Jan 15 '14 at 7:42
  • @xurshid29 they not important, the question is how hide E_STRICT warnings in php 5.4 in drupal 6 – Yusef Mohamadi Jan 15 '14 at 7:45
  • error_reporting = ~E_ALL Have u tried this – harshal Jan 15 '14 at 7:46
  • @harshal , I want see errors not hide all !!! – Yusef Mohamadi Jan 15 '14 at 7:48
  • pls check the answer – harshal Jan 15 '14 at 7:54
4

From the link :

If you're going to hack core, a much better solution is to properly fix the error handler. Add this line to the top of the drupal_error_handler function in includes/common.inc:

if ($errno == E_STRICT) { return; }

  • If I dont find a way, I have to patch core. I see this link before . – Yusef Mohamadi Jan 15 '14 at 8:41
3

Go to this url admin/settings/error-reporting and set the option write errors to the log for Error reporting dropdown.

  • Why in the world did someone vote this down? Although this will hide all errors, and not just warnings, it's certainly a much better approach than hacking core, no matter how proper the fix. – forest May 7 '14 at 13:48
  • IMHO, This is not that much of a better approach than hacking core because your logs fill up with useless messages that you're more than aware of, but have your hands tied about actually fixing them. This is a common situation while running a D6 site on PHP 5.4 where E_ALL contains E_STRICT. I've come to the conclusion that @harshal's answer is the best one available. – JamesWilson Oct 29 '14 at 19:17
1

If anyone is reading this in 2016 or beyond (what are you still doing using Drupal 6? :P) then there is now a module that does what harshal's answer suggests to suppress PHP warnings - without hacking core.

See: https://www.drupal.org/project/___drupal_php_strict_suppress

-3

Watch this youtube video this is axactly what you want its easy and helpfull and don't forget to change resolution to 460 before watching https://www.youtube.com/watch?v=i5Hq6t8Z6Fo

  • 1
    This answer is absolute not helpful in this question. Not only requires to watch a video instead to write down an answer, but the video content is inadequate in this topic. Hiding error messages in PHP is not help to resolve this issue in Drupal itself. – Gabor Garami Sep 16 '14 at 8:39
  • @Arman : I appreciate your intent to answer this question, but please dont post links as that will not be usefull when the link is broken or the content is removed. So in case of any future answers, kindly write a short note about the solution. – Gladiator Sep 23 '14 at 11:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.