Reputation: 557
I have an shared host and wrote an php shell for get piped emails. this host always make an error log like this:
PHP Warning: PHP Startup: Suhosin Extension does not officially support PHP 5.2 and below anymore, because it is discontinued. Use it at your own risk. in Unknown on line 0
and this warning pass to mail delivery software and it think the mail didn't receive. I try to use error_reporting(0) and ob_start() with ob_end_clean(). but this error still pass to mail delivery software. how I can clear PHP startup warnings with PHP codes in my script?
Upvotes: 0
Views: 3217
Reputation: 2752
Do you mean that you get this startup error in php in the shell but not on normal web pages? If so, how are you piping the command through the shell? have you tried redirecting stderr to /dev/null ? -- i.e. append 2>/dev/null
to the command.
Alternative hackage could include piping through grep to filter out the line.
Upvotes: 0
Reputation: 2092
In your php.ini file look for "display_errors" and set it to Off. If you don't have access to the php.ini file, then at the START of your php file put: ini_set("display_errors","Off");
Try this ..
Upvotes: 1
Reputation: 342
have you try those options ? : display_startup_errors & display_errors
Upvotes: 1