You are here: Re: "SSL: Fatal Protocol Error" with fsockopen() « PHP Programming Language « IT news, forums, messages
Re: "SSL: Fatal Protocol Error" with fsockopen()

Posted by Rik on 02/23/07 20:39

keychain <somebody@somewhere.com> wrote:
> "Kim André Akerø" <kimandre@NOSPAMbetadome.com> wrote
>>> I'm experience the infamous "SSL: Fatal Protocol Error" bug with
>>> Apache 2.x
>>>
>>> According the fopen() documentation:
>>>
>>> "If you are using fsockopen() to create an ssl:// socket, you are
>>> responsible for detecting and suppressing the warning yourself."
>>>
>>> I have been unable to determine how to go about suppressing these
>>> warnings. Any help would be greatly appreciated.
>>
>> You can supress warnings by putting an @ directly in front of the
>> function name, like this:
>>
>> $handle = @fsockopen("ssl://server.example.com", 443);
>
> Kim, that's a great tip--thanks!
>
> You can optionally use
>
> error_reporting(0);
>
> but this suppresses all warnings, which is obviously less desirable.

Supressing warnings is not the way to go. What if something else fails
then the thing you expected to fail? Just set display_errors to false in
your configuration (php.ini/http.conf/.htaccess/php-script itself) and log
them to a file. Certainly advisable for live projects. Just parse the
error log once in a while to check wether something odd is going on, or
check it when something is indeed off or it grows with an alarming pace.

And BTW, error_reporting can be set back offcourse:
$temp = error_reporting(0);
fsockopen();
error_reporting($temp);
--
Rik Wasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация