i am having a problem with PHP file_get_contents.i am trying to fetch inforamtion following url but is not getting information.it's showing following error.i have try curl code also but same error is displayed
PHP Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure in /home/tshah/public_html/pramod/expressdecorViolation/classes/scrap1.php on line 83
PHP Warning: file_get_contents(): Failed to enable crypto in /home/tshah/public_html/pramod/expressdecorViolation/classes/scrap1.php on line 83
PHP Warning: file_get_contents(http://www.overstock.com/Home-Garden/Kraus-30-inch-Undermount-Single-Bowl-Steel-Kitchen-Sink/3381330/customer-reviews.html?rsort=1): failed to open stream: operation failed
mycode is:
$link = 'http://www.overstock.com/Home-Garden/Kraus-30-inch-Undermount-Single-Bowl-Steel-Kitchen-Sink/3381330/customer-reviews.html?rsort=1';
$Page_information = file_get_contents($link);
print_r($Page_information);
Related
I was just starting to test use Simple HTML DOM Parser to parse google.com, while getting the following error:
Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /Applications/Ampps/www/scraper/simplehtmldom_1_9_1/simple_html_dom.php on line 82
Warning: file_get_contents(): Failed to enable crypto in /Applications/Ampps/www/scraper/simplehtmldom_1_9_1/simple_html_dom.php on line 82
Warning: file_get_contents(https://google.com): failed to open stream: operation failed in /Applications/Ampps/www/scraper/simplehtmldom_1_9_1/simple_html_dom.php on line 82
And my scraper_test.php looks like this:
include('./simplehtmldom_1_9_1/simple_html_dom.php');
$html = file_get_html('https://google.com');
echo $html->find('title', 0)->plaintext;
I am trying to access a php script from my other site to my new site and I Am getting this error:
Warning: require_once(): SSL operation failed with code 1. OpenSSL
Error messages: error:14077410:SSL
routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure in
/home/newsite/public_html/abc.php on line 3
Warning: require_once(): Failed to enable crypto in
/home/newsite/public_html/abc.php on line 3
Warning: require_once(https://www.example.com/abc/abc.xyz.php): failed
to open stream: operation failed in /home/newsite/public_html/abc.php
on line 3
Fatal error: require_once(): Failed opening required
'https://www.example.com/abc/abc.xyz.php'
(include_path='.:/usr/local/lib/php') in
/home/newsite/public_html/abc.php on line 3
I just bought rapid SSL as I thought this was SSL issue and SSL is activated now but I still get same error.
I followed a certain tutorial found here to install Wordpress onto App Engine, using a SQL Cloud Database.
I'm up to the point when I have to run the setup script to download the Wordpress archive and plugins. When that command is ran I get the following errors:
Downloading the WordPress archive...
Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in /Users/Me/Sites/Blog/src/Project.php on line 47
Warning: file_get_contents(): Failed to enable crypto in /Users/Me/Sites/Blog/src/Project.php on line 47
Warning: file_get_contents(https://wordpress.org/latest.zip): failed to open stream: operation failed in /Users/Me/Sites/Blog/src/Project.php on line 47
I've looked at multiple resources to combat this issue such as, this one, where they suggest to set the verification to the peer to false, but I do not have that option within this project. I also found that someone suggested to use curl instead but I'm unsure how to use that without breaking the project.
I am trying to fetch youtube videos using Youtube Data API URL. Whenever i paste the URL directly in the address bar, it perfectly shows the result. But whenever i try to use that URL in simplexml_load_file() function, i get errors. I cannot figure out what is going on.
This is how i am doing this.
$url = "https://gdata.youtube.com/feeds/api/videos/-/cat";
$output = simplexml_load_file($url);
echo "<pre>";
print_r($output);
echo "</pre>";
I am getting this error message.
Warning: simplexml_load_file(): SSL: The operation completed successfully. in J:\xampp\htdocs\youtube\tube.php on line 23
Notice: simplexml_load_file(): send of 38 bytes failed with errno=10054 An existing connection was forcibly closed by the remote host. in J:\xampp\htdocs\youtube\tube.php on line 23
Notice: simplexml_load_file(): send of 25 bytes failed with errno=10054 An existing connection was forcibly closed by the remote host. in J:\xampp\htdocs\youtube\tube.php on line 23
Notice: simplexml_load_file(): send of 2 bytes failed with errno=10054 An existing connection was forcibly closed by the remote host. in J:\xampp\htdocs\youtube\tube.php on line 23
Warning: simplexml_load_file(https://gdata.youtube.com/feeds/api/videos/-/cat): failed to open stream: HTTP request failed! in J:\xampp\htdocs\youtube\tube.php on line 23
Warning: simplexml_load_file(): I/O warning : failed to load external entity "https://gdata.youtube.com/feeds/api/videos/-/cat" in J:\xampp\htdocs\youtube\tube.php on line 23
I tried to use file_get_contents() function it also gives error.
$url = "https://gdata.youtube.com/feeds/api/videos/-/cat";
$output = file_get_contents($url);
echo $output;
I get these errors using above code.
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: No such host is known. in J:\xampp\htdocs\youtube\tube.php on line 15
Warning: file_get_contents(https://gdata.youtube.com/feeds/api/videos/-/cat): failed to open stream: php_network_getaddresses: getaddrinfo failed: No such host is known. in J:\xampp\htdocs\youtube\tube.php on line 15
I also tried to use simplexml_load_string() function it also gives error.
$url = "https://gdata.youtube.com/feeds/api/videos/-/cat";
$output = simplexml_load_string($url);
echo "<pre>";
print_r($output);
echo "</pre>";
The above code gives me these errors.
Warning: simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found in J:\xampp\htdocs\youtube\tube.php on line 14
Warning: simplexml_load_string(): https://gdata.youtube.com/feeds/api/videos/-/cat in J:\xampp\htdocs\youtube\tube.php on line 14
Warning: simplexml_load_string(): ^ in J:\xampp\htdocs\youtube\tube.php on line 14
I am using XAMPP v3.2.1 to run my script.
Please help. Thanks.
First you have to check that remote file access is enabled, read the PHP manual page about Using remote files.
After that, and if your firewall is not blocking connections, almost any option that you tried should work. But, in any case, here you have one using simpler commands, or at least simpler concerning what is working internally. Just a good old fopen.
// initialize variables
$url = 'https://gdata.youtube.com/feeds/api/videos/-/cat';
$content = false;
$handle = false;
// open the url/file
$handle = fopen( $url, 'r' );
// get the content from streaming
$content = stream_get_contents($handle);
// close the file reading session
fclose( $handle );
var_dump( $content );
I have been getting this error messages from my PHP code used to send message to the APNS...has anyone got faced the same issue?
Warning: stream_socket_client() [function.stream-socket-client]: SSL operation
failed with code 1. OpenSSL Error messages: error:14094410:SSL routines:
SSL3_READ_BYTES:sslv3 alert handshake failure in
/Library/WebServer/Documents/anish/apns/2.php on line 8
Warning: stream_socket_client() [function.stream-socket-client]: Failed to enable
crypto in /Library/WebServer/Documents/anish/apns/2.php on line 8
Warning: stream_socket_client() [function.stream-socket-client]: unable to connect
to ssl://gateway.sandbox.push.apple.com:2195 (Unknown error) in /Library/WebServer
/Documents/anish/apns/2.php on line 8
Failed to connect: 0
Warning: fclose(): supplied argument is not a valid stream resource in
/Library/WebServer/Documents/anish/apns/2.php on line 20*
Also it seems it always fails to connect to gateway.sandbox.push.apple.com. I even tried with PushMeBaby and it too fails to connect to gateway.sandbox.push.apple.com
the problem apparently was with the installation of certificates. If the certificate are installed properly, then everything works great like a charm..!