Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Formatink's avatar

Use a curl package

Hello,

I'm trying to use this package : http://packalyst.com/packages/package/jyggen/curl

$request = new \Jyggen\Curl\Request('https://laracasts.com');
$request->execute();
if ($request->isSuccessful()) {
   dd($request->getRawResponse());
}

But I get this error when I try to make a request

CurlErrorException in Request.php line 193: 
SSL certificate problem: self signed certificate in certificate chain

However, in my PHP configuration file, I indicated the path to my cacert.pem file. Here is its content : http://curl.haxx.se/ca/cacert.pem

My PHP configuration file :

[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
curl.cainfo = "c:/wamp/bin/php/cacert.pem"

Could you please help me? Thank you in advance.

Regards

0 likes
3 replies
bashy's avatar

Also Windows paths are backslash?

Formatink's avatar

Thank you for your answers. Yes, it's working but why only in dev ?

I tried to change the CURLOPT_CAINFO option with the path of the cacert.pem file and it is working also

$request->setOption(CURLOPT_CAINFO, 'C:/wamp/bin/php/cacert.pem');

But if I do like this, I have to indicate the path and add the file in production also. Is there an easier way to do that ?

EDIT :

@Kryptonit3 Ah yes, ok. Either I indicate the path by changing the CURLOPT_CAINFO option or I disable the SSL verification ?

Formatink's avatar

I correctly added the path to my file in my PHP configuration (C:\wamp\bin\php\php5.5.12\php.ini) but it does not work. I don't think that there may be an issue with pulling it from php.ini. I have no apache / php logs.

Please or to participate in this conversation.