This is required to be anĬurl.cainfo = C:\Users\MyUserName\cacert.pem A default value for the CURLOPT_CAINFO option. Open php.ini, find the block show below and add the absolute path of the certificate to it: I keep mine in the home folder which is C:\Users\MyUserName\ on the PC. Go to the following folder C:WindowsSystem32driversetc and open the hosts file, paste the following line and save it. We will use laravel.test in this tutorial. Now dream a custom domain for your project.
Since I wanted to be able to run the command in the Git Bash terminal, I had to fix the problem.įirst, if you don't already have a generic SSL certificate (local/test environment only - NEVER USE THIS IN PRODUCTION), grab one from here. Custom domain for your Laravel project on localhost.
If you don't care about being able to make Guzzle requests in your local terminal (using the locally-installed PHP), then try running it from the Vagrant box. As expected this worked because Homestead is properly configured, including SSL certificates. The first thing I tried successfully was to ssh into the Vagrant box and run the artisan command from there. Previously, I had screwed up a local SSL certificate that I was using for https in the browser for my local projects.
#Vagrant vs ampps upgrade
I'm almost certain that the PHP 7.4 upgrade wasn't the only cause. Please use the argument -v to see more details. > 201| : new RequestException($message, $easy->request, $easy->response, null, $ctx) Ģ03| return \GuzzleHttp\Promise\rejection_for($error) ġ GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle))Ĭ:\Users\MyUserName\code\myproject\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:155Ģ GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory))Ĭ:\Users\MyUserName\code\myproject\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:105 The request is done using Guzzle and I received the following cURL error: GuzzleHttp\Exception\RequestException : cURL error 60: SSL certificate problem: unable to get local issuer certificate (see )Īt C:\Users\MyUserName\code\myproject\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:201ġ98| // Create a connection exception if it was a specific error code.ġ99| $error = isset($connectionErrors)Ģ00| ? new ConnectException($message, $easy->request, null, $ctx) I ran the command in my Git Bash terminal.
#Vagrant vs ampps windows
Right after upgrading my local PHP environment to 7.4 on the Windows laptop that I use at work, I ran a Laravel artisan console command for an HTTP request to a 3rd party API.