Page 1 of 1
Warning: file_get_contents()...
Posted: Tue Aug 21, 2007 6:12 pm
by SidewinderX
In console:
stssquad@rps [~/www/squadstats]# php update.php
Output:
Warning: file_get_contents(): SSL: fatal protocol error in /home/stssquad/public_html/squadstats/update.php on line 16
https://www.novaworld.com/Players/Stats ... 7&p=616065
No log handling enabled - turning on stderr logging
Creating directory: /var/net-snmp
Failed to create the persistent directory for /var/net-snmp/snmpapp.conf
read_config_store open failure on /var/net-snmp/snmpapp.conf
Creating directory: /var/net-snmp
Failed to create the persistent directory for /var/net-snmp/snmpapp.conf
read_config_store open failure on /var/net-snmp/snmpapp.conf
Creating directory: /var/net-snmp
Failed to create the persistent directory for /var/net-snmp/snmpapp.conf
read_config_store open failure on /var/net-snmp/snmpapp.conf
Code:
Code: Select all
<?php
include("config.php");
error_reporting(E_ALL);
$result40 = mysql_query("SELECT * FROM " . $dbtable , $db);
while ($row40 = mysql_fetch_assoc($result40))
{
$pid = $row40['pid'];
//Gets the content of the submited URL;
$url = "https://www.novaworld.com/Players/Stats.aspx?id=".$row40['pid']."&p=616065";
print "$url\r\n";
/*line 16 */ $content = file_get_contents($url);
//Strips the tags of the $content;
$strip = strip_tags($content);
...
Why is it generating the warnings?
Posted: Tue Aug 21, 2007 6:26 pm
by feyd
https isn't an internal protocol, it's "ssl"
Re: Warning: file_get_contents()...
Posted: Tue Aug 21, 2007 6:35 pm
by volka
That page is served by an iis5 server.
Maybe you have an old php (or openssl) version?
http://de2.php.net/wrappers.http wrote:Warning
When using SSL, Microsoft IIS will violate the protocol by closing the connection without sending a close_notify indicator. PHP will report this as "SSL: Fatal Protocol Error" when you reach the end of the data. To workaround this, you should lower your error_reporting level not to include warnings. PHP 4.3.7 and higher can detect buggy IIS server software when you open the stream using the https:// wrapper and will suppress the warning for you. If you are using fsockopen() to create an ssl:// socket, you are responsible for detecting and suppressing the warning yourself.
Posted: Tue Aug 21, 2007 6:49 pm
by SidewinderX
PHP Version 5.1.6
OpenSSL Version OpenSSL 0.9.7a Feb 19 2003
I'll update SSL and see if that does anything...
Do the SSL warnings have anything to do with the latter error? Even if i set my error reporting to lower, I get still get their error.
No log handling enabled - turning on stderr logging
Creating directory: /var/net-snmp
Failed to create the persistent directory for /var/net-snmp/snmpapp.conf
read_config_store open failure on /var/net-snmp/snmpapp.conf
Creating directory: /var/net-snmp
Failed to create the persistent directory for /var/net-snmp/snmpapp.conf
read_config_store open failure on /var/net-snmp/snmpapp.conf
Creating directory: /var/net-snmp
Failed to create the persistent directory for /var/net-snmp/snmpapp.conf
read_config_store open failure on /var/net-snmp/snmpapp.conf
Posted: Tue Aug 21, 2007 8:20 pm
by volka
Hm. What does
Code: Select all
<?php
include("config.php");
error_reporting(E_ALL);
var_dump( extension_loaded('snmp') );
echo "<br />\n", phpversion(), "<br />\n";
$result40 = mysql_query("SELECT * FROM " . $dbtable , $db);
...
print?
Posted: Tue Aug 21, 2007 9:32 pm
by SidewinderX
stssquad@rps [~/www/squadstats]# php update.php
bool(true)
<br />
5.1.6<br />
Warning: file_get_contents(): SSL: fatal protocol error in /home/stssquad/public_html/squadstats/update.php on line 15
https://www.novaworld.com/Players/Stats ... 7&p=616065
No log handling enabled - turning on stderr logging
Creating directory: /var/net-snmp
Failed to create the persistent directory for /var/net-snmp/snmpapp.conf
read_config_store open failure on /var/net-snmp/snmpapp.conf
Creating directory: /var/net-snmp
Failed to create the persistent directory for /var/net-snmp/snmpapp.conf
read_config_store open failure on /var/net-snmp/snmpapp.conf
Creating directory: /var/net-snmp
Failed to create the persistent directory for /var/net-snmp/snmpapp.conf
read_config_store open failure on /var/net-snmp/snmpapp.conf
ok, i managed to get my ssh back, and those are the results
Posted: Wed Aug 22, 2007 5:03 am
by volka
You have the
http://de2.php.net/snmp extension enabled. The output after
comes from this extension (I think...)
The strange thing is: Again that's a bug that should have been fixed in php 4.3.x
see
http://bugs.php.net/bug.php?id=32613
Re: Warning: file_get_contents()...
Posted: Fri Apr 25, 2008 2:38 pm
by Asmodeux
I'm having problems with this as well. I get
Warning: file_get_contents() [function.file-get-contents]: SSL: fatal protocol error
I'm using PHP 5 so this should not be a problem if I understand
$rssURL = '
https://tbe.taleo.net/NA3/ats/servlet/R ... bVersion=0'
$doc = new DOMDocument();
$doc->preserveWhiteSpace = false;
$doc->load(
file_get_contents($rssURL));
Of course if I try some URL like this, everything is fine
http://rss.cbc.ca/lineup/money.xml
Re: Warning: file_get_contents()...
Posted: Fri Apr 25, 2008 2:50 pm
by Asmodeux
Saw this on that POST
When using SSL, Microsoft IIS will violate the protocol by closing the connection without sending a close_notify indicator. PHP will report this as "SSL: Fatal Protocol Error" when you reach the end of the data. To workaround this, you should lower your error_reporting level not to include warnings. PHP 4.3.7 and higher can detect buggy IIS server software when you open the stream using the https:// wrapper and will suppress the warning for you. If you are using fsockopen() to create an ssl:// socket, you are responsible for detecting and suppressing the warning yourself.
But I'm using PHP 5 so I don't think I need this. Beside, I don't find how to
lower the error_reporting level
Any help
