0
$stream = stream_context_create( $params );
$fp = fopen( 'https://'.$host.$path, 'rb', false, $stream );
if(!$fp) {
  throw new Exception ( "Exception Occured can't open" );
}
$response = stream_get_contents ( $fp );

I'm accessing amazon product advertising API using fopen. Most of the time the code works fine but sometimes it throws an error or warning I can't really tell because It just says the operation completed successfully.

fopen(): SSL: The operation completed successfully

and stops code execution

3
  • try catch and get the error?
    – Cid
    Aug 6, 2020 at 7:15
  • oh right thank you
    – Andrei dev
    Aug 6, 2020 at 7:31
  • @Cid would you please put that in the answer section?
    – Default
    Sep 16, 2020 at 15:53

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.