I just installed the Modern Events calendar plugin and I’m getting this error: "file_get_contents" and “Curl” functions are not activated on your server. Please contact your host provider in this regard.
Hey @mikemuller – It’s hard to know how that plugin is coming to it’s conclusion that those functions aren’t working and it might be worthwhile to reach out to the plugin developer to get more info.
For background info, the file_get_contents() function is built into PHP and is used to read a file as a string into a variable:
Given that the plugin is also mentioning curl – that makes me think that they are trying to retrieve some sort of remote file. Either way, it’s probably a good idea to reach out to the plugin devs to see what they are trying to do and verify that things are actually breaking within Local.
They are trying to pull a remote .json file. I reached out to them and they said it was a server issue. If I put this up on a server it works properly but not with Local. Must be some sort of block because I’m working locally.
Nice! I think you’re reading of the error message is correct – it’s something preventing the WordPress site from making a secure connection over HTTPS.
From the log path separator, it looks like you are using macOS – what version is installed?
If you click on the “Trust” button within Local to register the SSL certificate with the computer, does that remove the error message and allow you to use those functions?
Hi Ben, I’m using 10.15.6. I do have the SSL trusted. Is there a way to re-trust the cert? Or there’s an issue with the SSL locally which doesn’t validate.
Thanks for mentioning that it’s working with Lando! Since Lando is built on Docker, that makes me think that there’s an issue with the OpenSSL certs that Local’s version of PHP is using.
As a test, I tried using the URL in the error message you provided and was able to connect to the API over HTTPS:
Do you have any antivirus software installed? Since Local’s software is installed directly on the Host machine, it might be that there is something that is interfering with Local’s version of PHP. The reason that something like Lando would work in this case is that it’s a virtualized environment and so it wouldn’t be subject to security settings on the host machine.
Sure @mikemuller – If you send me a DM, with the plugin attached I can take a look. Just so I know exactly where I’m looking – what’s the URL where you are seeing that original error message?
Thanks for your patience with this @mikemuller – I tried various permutations of site setup:
New site with “Site domains” router mode, over regular HTTP
New site with “Site domains” router mode, over HTTPS
New site with “localhost” router mode, over HTTP
In all those cases, I was able to access the “addon” page for that plugin in the WP admin. That makes me think that there’s something specific with that site, possibly a conflict with another plugin or the theme.
Can you try using that plugin on a new, plain WordPress site with the default theme? If that does work for you then I would recommend zeroing in on which plugins are causing issues by deactivating them and re-enabling them one-by-one.
I get the same error:
Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in /Users/mikemuller/Sites/test/app/public/wp-content/plugins/modern-events-calendar/app/features/mec/addons.php on line 39
It could be some sort of setup with that Mac. Is this a work computer, for example, did the company implement any sort of security settings – I’m thinking of something like issuing their own SSL certificate or CA authority.
One other idea – How long have you had Local installed?
I wonder if maybe there’s an old version of the PHP service that needs to be updated? You could try first backing up your sites, and then the steps outlined in this reply, which deletes the current PHP service and downloads the latest ones:
I just installed a brand new virtual mac OS machine and a fresh copy of Local and am getting the same error. The install of MacOS is 10.15.5 which is Catalina. This version should not have any old versions of PHP.
What computer and OS are you using where it’s working?