Installing the plugins of CKEditor printing error messages regarding SSL via Composer

Installing the plugins of CKEditor printing error messages regarding SSL via Composer

Profile picture for user a65162

Most of the projects will manage all of the dependency packages via Composer because it is easy and convenient. However, I attempted to download the CKEditor packages on macOS, then it gave me error messages that I didn't see them before. If you have same problems, just follow below tips to solve the problems.

First error message:

Content-Length mismatch, received 0 out of 290 bytes: ()

Just upgrade Composer to settle the problem.

Second error message: Installing the plugin of CKEditor printed error messages regarding SSL via Composer

This problem will be shown when you upgrade the Composer and it gives you more detail about what it is going on. As you can see the above picture, it tells you SSL is verify failed so the problem is a wrong or missing SSL certificate. Now printing the certificate locations in PHP showed you the following settings. 

php -r 'print_r(openssl_get_cert_locations());'

Installing the plugins of CKEditor printed error messages regarding SSL via Composer

Make sure "default_cert_file" that shows the certificate really exists in the location. if not, you have to generate a certificate. 

"ini_cafile" have to be given a value as same as "default_cert_file". First, you need to find the php.ini, which is the current version of PHP that you are using, from your system. Copy the value of "default_cert_file" and then, paste the value to "openssl.cafile" .

After you finish, check the certificate again.

php -r 'print_r(openssl_get_cert_locations());'

Installing the plugins of CKEditor printed error messages regarding SSL via Composer

After you see the "ini_cafile" have value, Composer will be downloaded plugins of CKEditor successfully.

Related Posts