• Resolved montanan

    (@montanan)


    I have had a plugin running from sometime now and then it stopped working. This is the code in question.

    $url = plugins_url( '/' , __FILE__ );
    $op = file_get_contents(plugins_url( '../PRTHSEL_Visualizer.html' , __FILE__ ));
    

    All the searching tells me it is a problem with the certificate. Inmotionshosting says it is my plugin. It is not telling me my path is inncorrect. I have this plugin running on a bluehost account no problem. Is there a different way to get file content to parse that works? I tried fopen and fread but I still get SSL errors.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter montanan

    (@montanan)

    My hosting company change their PHP from 7 to 5 and now it works. However if anybody has an insight to why PHP 7 would give this error I would appreciate it?

    file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in...

    Dion

    (@diondesigns)

    PHP 7.x defaults to verifying SSL certificates. PHP 5.x defaults to not verifying SSL certificates.

    But the problem here is in the plugin’s code. Using a URL to retrieve a local file with file_get_contents() is, well, dumb. It should instead be retrieving the file using a filesystem path.

    Thread Starter montanan

    (@montanan)

    Yes, that was dumb. I thought for sure I was using a local path. Thanks because now I have it working with PHP7

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Plugin fail due to SSL error’ is closed to new replies.