0

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); 
pramod24
  • 1,096
  • 4
  • 17
  • 38
  • Have you checked this : http://stackoverflow.com/questions/26148701/file-get-contents-ssl-operation-failed-with-code-1-and-more – Kinshuk Lahiri Sep 29 '16 at 13:22
  • 1
    Works for me. Do you have `php_openssl` enabled in your `php.ini` – RiggsFolly Sep 29 '16 at 13:22
  • Or maybe you have to upgrade `php_openssl` to a newer version – RiggsFolly Sep 29 '16 at 13:26
  • @ RiggsFolly In php.ini file php_openssl is not available – pramod24 Sep 29 '16 at 13:35
  • I have a stroke every time I see someone using file_get_contents to open an external URL instead of a local file. Come on, if you want to open anything through HTTP use a function that was originally created for HTTP requests so you can check the HTTP status code, at the very least! – Aleuck Dec 17 '19 at 15:45

0 Answers0