Title: Plugin fail due to SSL error
Last modified: May 24, 2018

---

# Plugin fail due to SSL error

 *  Resolved [montanan](https://wordpress.org/support/users/montanan/)
 * (@montanan)
 * [8 years ago](https://wordpress.org/support/topic/plugin-fail-due-to-ssl-error/)
 * 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](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fplugin-fail-due-to-ssl-error%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Thread Starter [montanan](https://wordpress.org/support/users/montanan/)
 * (@montanan)
 * [8 years ago](https://wordpress.org/support/topic/plugin-fail-due-to-ssl-error/#post-10320488)
 * 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](https://wordpress.org/support/users/diondesigns/)
 * (@diondesigns)
 * [8 years ago](https://wordpress.org/support/topic/plugin-fail-due-to-ssl-error/#post-10323829)
 * 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](https://wordpress.org/support/users/montanan/)
 * (@montanan)
 * [8 years ago](https://wordpress.org/support/topic/plugin-fail-due-to-ssl-error/#post-10325092)
 * 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.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 3 replies
 * 2 participants
 * Last reply from: [montanan](https://wordpress.org/support/users/montanan/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/plugin-fail-due-to-ssl-error/#post-10325092)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
