php composer certificate verify failed

错误

1
2
3
4
5
[Composer\Downloader\TransportException]
The "https://packagist.phpcomposer.com/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed

解决

composer.lock 文件删除,重新执行 composer install