I started receiving error messages a few days and the problem was pointed to this code.
function doUpload( $cid, $item )
{
$torrent = tempnam( '/tmp', 'articles' );
$handler = fopen( $articles, 'w' );
$fgetfiles = file_get_contents( ( string ) $item -> enclosure -> attributes() -> url);
fwrite( $handler, $fgetfiles );
fclose( $handler );
$description = ( string ) $item -> description;
The error messages I received were
file_get_contents(): Failed to enable crypto in line 77
the line 77 is shown below
$fgetfiles = file_get_contents( ( string ) $item -> enclosure -> attributes() -> url);
So this were the changes I made after I got this error:
I downloaded a CA_Bundle cert and added the path inside php.ini Restarted the server and run the code again but error was still there..
-
I disabled verification of SSL, by adding the code below, but that failed as well.
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
-
Enabled SSL Verification by adding the cert to directory in which script is located and set verification to true but same errors.
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_CAINFO, dirname(FILE) . '/cacert.pem');
I would like to know if there is something I'm not doing right here because the errors I keep receiving are always the same regardless of the changes I make and it all points to
$fgetfiles = file_get_contents( ( string ) $item -> enclosure -> attributes() -> url); //Line 77
I'm currently running this on Nginx + PHP-FPM. Any help would be appreciated.