Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http_request_failed cURL error 60 - can't download from wordpress.org #930

Open
Jack-ongithub opened this issue Dec 16, 2024 Discussed in #917 · 19 comments
Open

http_request_failed cURL error 60 - can't download from wordpress.org #930

Jack-ongithub opened this issue Dec 16, 2024 Discussed in #917 · 19 comments
Assignees
Milestone

Comments

@Jack-ongithub
Copy link

I am not the original poster. I have added a docx file with related errors. I have been using Laragon for years without this occurring, so I am concerned about how to address it. The directions in the error messages point to files like php.ini that do not exist on the previously installed WP websites that work properly.
Jack
Laragon errors in WP 20241215.docx

Discussed in #917

Originally posted by kostritsaalex November 23, 2024
Hi guys,

Can you help me to address this issue:
Array ( [0] => http_request_failed cURL error 60: SSL certificate problem: self signed certificate )

What was done:

  1. Followed that guideline: https://pen-y-fan.github.io/2022/11/10/how-to-set-up-laragon-on-a-new-windows-computer-part-4/
  2. Downloaded 'cacert.pem' and Updated php.ini conf additionally:

`[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
;curl.cainfo =
curl.cainfo = "C:\laragon\bin\php\php-8.1.10-Win32-vs16-x64\extras\ssl\cacert.pem"

[openssl]
; The location of a Certificate Authority (CA) file on the local filesystem
; to use when verifying the identity of SSL/TLS peers. Most users should
; not specify a value for this directive as PHP will attempt to use the
; OS-managed cert stores in its absence. If specified, this value may still
; be overridden on a per-stream basis via the "cafile" SSL stream context
; option.
openssl.cafile = "C:\laragon\bin\php\php-8.1.10-Win32-vs16-x64\extras\ssl\cacert.pem"`

Thanks!

@leokhoa leokhoa self-assigned this Dec 18, 2024
@leokhoa leokhoa added this to the Laragon 7.1 milestone Dec 18, 2024
@Jack-ongithub
Copy link
Author

Jack-ongithub commented Dec 28, 2024

I created a new instance of WordPress. I get a warning (not verbatim) that D:\localserver-Laragon\www\testlaragon20241228\wp-includes\pomo\plural-forms.php has "continue" in line 210 which is equivalent to "break". Did I mean "continue 2"?

I tried to update the Hello Dolly plugin and got the curl error again. Also got the above warning again.
(I get that same warning on all the sites I have tested, but not always pointing at the same file.)

I edited the PHP file to be "continue 2"

I tried updating a theme. I got the following (verbatim):

An error occurred while updating Twenty Fifteen: Download failed. cURL error 60: SSL certificate problem: unable to get local issuer certificate

Warning: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in D:\localserver-Laragon\www\testlaragon20241228\wp-includes\update.php on line 347

Warning: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in D:\localserver-Laragon\www\testlaragon20241228\wp-includes\update.php on line 529

Edit: I don't know if it is germane, but the WP site in Laragon does not have an SSL or https:

@MackSix
Copy link

MackSix commented Dec 29, 2024

Check you System Variable path and make sure you don't have the wrong paths to another Laragon version. That will cause massive problems.

@Jack-ongithub
Copy link
Author

Thank you for responding!
I'm not sure where the setting you are referring to is. Do you mean the Windows environment setup or something specifically inside Laragon? I have looked through the various options in Laragon's menu and don't see anything that seems to meet your description.

@MackSix
Copy link

MackSix commented Dec 29, 2024

On the Laragon context menu: Tools >> Path >> Manage Path and it will show you what Laragon will add/remove and what it shows in your User and System file path. Make sure it is for your newest installation and you only have paths to the installation you are running.

On Windows this is Control Panel >> System & Security >> Advanced system settings >> Environment Variables

@Jack-ongithub
Copy link
Author

Thank you again. I saw your first message just as I was considering uninstalling Laragon and starting all over.

Here's what the path for Laragon shows in the window that you point to:
--------------- Laragon ---------------
;
C:\Users\Jack\AppData\Local\Yarn\config\global\node_modules.bin;
C:\Users\Jack\AppData\Roaming\Composer\vendor\bin;
C:\Users\Jack\AppData\Roaming\npm;
D:\localserver-Laragon\bin;
D:\localserver-Laragon\bin\apache\httpd-2.4.54-win64-VC15\bin;
D:\localserver-Laragon\bin\composer;
D:\localserver-Laragon\bin\git\bin;
D:\localserver-Laragon\bin\git\cmd;
D:\localserver-Laragon\bin\git\mingw64\bin;
D:\localserver-Laragon\bin\git\usr\bin;
D:\localserver-Laragon\bin\laragon\utils;
D:\localserver-Laragon\bin\mysql\mysql-5.7.19-winx64\bin;
D:\localserver-Laragon\bin\nginx\nginx-1.14.0;
D:\localserver-Laragon\bin\ngrok;
D:\localserver-Laragon\bin\nodejs\node-v8;
D:\localserver-Laragon\bin\notepad++;
D:\localserver-Laragon\bin\php\php-7.4.33-Win32-vc15-x64;
D:\localserver-Laragon\bin\putty;
D:\localserver-Laragon\bin\python\python-3.10;
D:\localserver-Laragon\bin\python\python-3.10\Scripts;
D:\localserver-Laragon\bin\redis\redis-x64-3.2.100;
D:\localserver-Laragon\bin\telnet;
D:\localserver-Laragon\bin\yarn\bin;
D:\localserver-Laragon\usr\bin;

I did a search (using Everything) for \bin\apache. All the Laragon entries are under: D:\localserver-Laragon\bin, which I take to mean that I am pointing at the right place. There are two other paths found that are for xampp, which I used before I switched to Laragon maybe 6 years ago.
I think this means that I am pointing at the right place. Correct?

@MackSix
Copy link

MackSix commented Dec 30, 2024

All of those entries should be under the USER section if it is applied. if you have xampp or any other paths in USER or SYSTEM after the correct laragon entries, you might have a bad time. If C:\A\B\D\httpd.exe is in your path and C:\Z\Y\X\httpd.exe is after it and it is a different version, you are going to have problems. I am not sure if laragon uses the system or user variable paths for configuration files, but that is something to be aware of too.

@Jack-ongithub
Copy link
Author

I don't think that the xampp entries should be an issue. I don't think I've used xampp since I started using Laragon and Laragon was working fine until very recently. I am pasting the entire contents of the Laragon Tools Path window below, rather than just the Laragon portion as previously. I don't know if that helps or not.
Thank you for your ongoing help!

--------------- Laragon ---------------
;
C:\Users\Jack\AppData\Local\Yarn\config\global\node_modules.bin;
C:\Users\Jack\AppData\Roaming\Composer\vendor\bin;
C:\Users\Jack\AppData\Roaming\npm;
D:\localserver-Laragon\bin;
D:\localserver-Laragon\bin\apache\httpd-2.4.54-win64-VC15\bin;
D:\localserver-Laragon\bin\composer;
D:\localserver-Laragon\bin\git\bin;
D:\localserver-Laragon\bin\git\cmd;
D:\localserver-Laragon\bin\git\mingw64\bin;
D:\localserver-Laragon\bin\git\usr\bin;
D:\localserver-Laragon\bin\laragon\utils;
D:\localserver-Laragon\bin\mysql\mysql-5.7.19-winx64\bin;
D:\localserver-Laragon\bin\nginx\nginx-1.14.0;
D:\localserver-Laragon\bin\ngrok;
D:\localserver-Laragon\bin\nodejs\node-v8;
D:\localserver-Laragon\bin\notepad++;
D:\localserver-Laragon\bin\php\php-7.4.33-Win32-vc15-x64;
D:\localserver-Laragon\bin\putty;
D:\localserver-Laragon\bin\python\python-3.10;
D:\localserver-Laragon\bin\python\python-3.10\Scripts;
D:\localserver-Laragon\bin\redis\redis-x64-3.2.100;
D:\localserver-Laragon\bin\telnet;
D:\localserver-Laragon\bin\yarn\bin;
D:\localserver-Laragon\usr\bin;

--------------- User ---------------
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;
C:\Users\Jack\AppData\Roaming\npm;
C:\Users\Jack\AppData\Roaming\Amazon

--------------- System ---------------
C:\Program Files\Python310\Scripts;
C:\Program Files\Python310;
C:\Program Files (x86)\ImageMagick-7.0.10-Q8;
C:\Program Files\ImageMagick-7.0.6-Q16;
C:\ProgramData\Oracle\Java\javapath;
C:\Program Files\Common Files\Microsoft Shared\Windows Live;
C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;
C:\Program Files (x86)\Intel\iCLS Client;
C:\Program Files\Intel\iCLS Client;
%SystemRoot%\system32;
%SystemRoot%;
%SystemRoot%\System32\Wbem;
%SYSTEMROOT%\System32\WindowsPowerShell\v1.0;
C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x86;
C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x64;
C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;
C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;
C:\Program Files (x86)\Windows Live\Shared;
C:\Windows\SysWOW64;
C:\Program Files (x86)\Skype\Phone;
C:\Program Files (x86)\QuickTime\QTSystem;
%SYSTEMROOT%\System32\WindowsPowerShell\v1.0;
%SYSTEMROOT%\System32\OpenSSH;
C:\Program Files\nodejs;
C:\Program Files\dotnet\

@MackSix
Copy link

MackSix commented Dec 30, 2024

You have no Laragon related path variables in use. If they are not under USER, they have no effect. It only shows you what Laragon adds/removes in the top part.

@Jack-ongithub
Copy link
Author

Hmm.
I can't say what the last update of the environment was. I do know that things had been working and that some still are.

I just tested loading a few existing Laragon sites. They loaded fine, except for the waring of:
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in D:\localserver-Laragon\www\bonopros\wp-content\plugins\participants-database\participants-database.php on line 1848
NOTE that the file pointed at changes with the website I load.

I tried updating the Astra theme in one site that I have been trying and got the error:

Downloading update from http://downloads.wordpress.org/theme/astra.4.8.8.zip…

An error occurred while updating Astra: Download failed. cURL error 60: SSL certificate problem: unable to get local issuer certificate

I loaded another site that I had not tried since the problem started, although it is fairly new. It's a multi-site installation. I loaded and then logged into the base site. No warnings were issued. I was able to update the Astra theme without problem. However, I could not access the child sites, either under View or under Dashboard. Got "Hmm...can't reach this page".

I loaded another, quite old, site that I had done some testing on a couple of months ago (before the problems). It loaded fine and I was able to do updates without issue.

I loaded a site a generated on 12/24/24 to test the issues. It loaded fine and I was able to login fine. I did not get the PHP warning about "continue". However, I was not able to update a plugin or a theme and got the cURL error.

Downloading update from http://downloads.wordpress.org/theme/twentyfifteen.3.9.zip…

An error occurred while updating Twenty Fifteen: Download failed. cURL error 60: SSL certificate problem: unable to get local issuer certificate

Warning: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in D:\localserver-Laragon\www\testlaragon20241228\wp-includes\update.php on line 347

Warning: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in D:\localserver-Laragon\www\testlaragon20241228\wp-includes\update.php on line 529

This has me thoroughly confused.
I am thinking of uninstalling Laragon using the Windows Control Panel and just starting over. I don't know if that will destroy the existing work or not.
Thoughts?

@MackSix
Copy link

MackSix commented Dec 31, 2024

I can't say what the last update of the environment was. I do know that things had been working and that some still are.

Your Environment Variable PATH for USER and SYSTEM is right there in your post. There is no Largon entries. All you have to do is click the link in the upper right of the window that displays that info to add the Largon path to USER. Then see if problems go away.

@Jack-ongithub
Copy link
Author

Thanks and Happy New Year.

I made that change.
When I went to some of the existing sites, the displays were strange, but by clicking internal links I did get to "normal". In addition, the first displays of the login screen were abnormal. That subsequently cleared up.
I am still getting the error on trying to update.
Since the error messages regarding the update failure mentions security I looked at the SSL situation. In the Laragon menu, it shows "enabled" for SSL, but I just discovered that is not what it means. I clicked on it and it now shows a check mark next to enable. Poor UI. I generated two new test sites - one blank and one WP. The did not have a SSLs.

Do you have any other suggestions?
What are your thoughts about uninstalling Laragon and just reinstalling it? Will the existing sites be lost or recovered if I reinstall?

@MackSix
Copy link

MackSix commented Jan 1, 2025

When you use Chrome, it can cause all sorts of problems when trying to line out SSL issues. You may need to reload or press ctrl+F5 to hard reload. You still may need to close Chrome and relaunch it to clear up Chrome saying the site is insecure after fixing SSL problems.

It looks like now you only have the plugin update problem with CURL not working because of: An error occurred while updating Twenty Fifteen: Download failed. cURL error 60: SSL certificate problem: unable to get local issuer certificate. Correct?

@Jack-ongithub
Copy link
Author

While I generally use Chrome for all my day to day work, I am using the portable version. MS Edge is the default browser and that is where the Laragon sites open.
I get the cURL error with any update I try: Hello Dolly, Astra, Twenty Fifteen.
And I am still getting the PHP warning about "continue". I am not getting the SSL, which is also true for sites I have just generated as a test.

@MackSix
Copy link

MackSix commented Jan 1, 2025

My php.ini files have this:

[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
;curl.cainfo =
curl.cainfo = "C:\Developer\laragon-7\etc\ssl\cacert.pem"

[openssl]
; The location of a Certificate Authority (CA) file on the local filesystem
; to use when verifying the identity of SSL/TLS peers. Most users should
; not specify a value for this directive as PHP will attempt to use the
; OS-managed cert stores in its absence. If specified, this value may still
; be overridden on a per-stream basis via the "cafile" SSL stream context
; option.
;openssl.cafile=

@MackSix
Copy link

MackSix commented Jan 1, 2025

You can do a new install of Largon 7 in another directory and try it. Once you do, Add/Remove programs will only show that version to remove. The other installation will work fine, but you can only run one or the other, not both.

@Jack-ongithub
Copy link
Author

thanks again!

I'm clearly in over my head.

I am currently using Laragon 6, which is a recent change. I think I was on 5, but may have been on 4 before all this started.

Did you have to generate the contents of the php.ini file manually or did the Laragon installation do it? The comments in the older sample below suggest not, but they are not repeated in the newer one.

I have 27 php.ini files in the \localserver-Laragon\ directory, of which 14 have either -devlopment or -production appended to their names - so 13 working copies in different sub-directories. 6 of those are different PHP or x86/x64 versions and the rest are in ...\www_project name_\wp-content\plugins\brizy\vendor... sub-directories.

Here's what is in D:\localserver-Laragon\bin\php\php-7.4.33-Win32-vc15-x64\php.ini which is the version I have been loading for Laragon 6:
[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
;curl.cainfo =
curl.cainfo = "D:\localserver-Laragon\etc\ssl\cacert.pem"

[openssl]
; The location of a Certificate Authority (CA) file on the local filesystem
; to use when verifying the identity of SSL/TLS peers. Most users should
; not specify a value for this directive as PHP will attempt to use the
; OS-managed cert stores in its absence. If specified, this value may still
; be overridden on a per-stream basis via the "cafile" SSL stream context
; option.
;openssl.cafile=

; If openssl.cafile is not specified or if the CA file is not found, the
; directory pointed to by openssl.capath is searched for a suitable
; certificate. This value must be a correctly hashed certificate directory.
; Most users should not specify a value for this directive as PHP will
; attempt to use the OS-managed cert stores in its absence. If specified,
; this value may still be overridden on a per-stream basis via the "capath"
; SSL stream context option.
;openssl.capath=

Here's what is in D:\localserver-Laragon\bin\php\php-5.6.9-Win32-VC11-x86\php.ini , which is ~2 years old. I don't remember what version I had been using under an older and working Laragon:

[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
;curl.cainfo =
curl.cainfo = "D:\localserver-Laragon\etc\ssl\cacert.pem"

[openssl]
; The location of a Certificate Authority (CA) file on the local filesystem
; to use when verifying the identity of SSL/TLS peers. Most users should
; not specify a value for this directive as PHP will attempt to use the
; OS-managed cert stores in its absence. If specified, this value may still
; be overridden on a per-stream basis via the "cafile" SSL stream context
; option.
;openssl.cafile=

; If openssl.cafile is not specified or if the CA file is not found, the
; directory pointed to by openssl.capath is searched for a suitable
; certificate. This value must be a correctly hashed certificate directory.
; Most users should not specify a value for this directive as PHP will
; attempt to use the OS-managed cert stores in its absence. If specified,
; this value may still be overridden on a per-stream basis via the "capath"
; SSL stream context option.
;openssl.capath=

@Jack-ongithub
Copy link
Author

If I just use Add/Remove to remove Laragon 6 and then reinstall, will the old work be lost?

@MackSix
Copy link

MackSix commented Jan 2, 2025

If I just use Add/Remove to remove Laragon 6 and then reinstall, will the old work be lost?

I uninstalled 6 and it leaves all the projects in the www folder. Zip the whole thing up to backup. If needed, just unzip it back, overwriting the new installation and it will be restored.

Did you have to generate the contents of the php.ini file manually or did the Laragon installation do it? The comments in the older sample below suggest not, but they are not repeated in the newer one.

I just installed 6, checked the SSL box in settings and it worked like a charm. I didn't have to do anything to get SSL to work right.

@Jack-ongithub
Copy link
Author

Sounds like the best shot would be to uninstall and reinstall. Not sure if I should go with 7 or stay with 6. I'm not prepared to pay for 7 and Leo is entitled to ask for the fee.
Once again, THANKS!

@leokhoa leokhoa modified the milestones: Laragon 7.1, Laragon 7.2 Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants