使用Composer在XAMPP上安装OS X Laravel失败



我已经按照Laravel文档的指示安装了composer。然后我运行以下命令来安装Laravel:composer create-project laravel/laravel your-project-name --prefer-dist

我得到以下信息:

    The "https://packagist.org/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
https://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date
Installing laravel/laravel (v5.1.4)
  - Installing laravel/laravel (v5.1.4)
    Downloading: 100%         
    Downloading: 100%         
    Downloading: 100%         
    Failed to download laravel/laravel from dist: The "https://api.github.com/repos/laravel/laravel/zipball/901a45fd96a7479e77f63ea5f8d1147a2766cafa" 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
    Now trying to download from source
  - Installing laravel/laravel (v5.1.4)
    Cloning 901a45fd96a7479e77f63ea5f8d1147a2766cafa
Created project in your-project-name
> php -r "copy('.env.example', '.env');"
Loading composer repositories with package information
The "https://packagist.org/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
https://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date
Installing dependencies (including require-dev)
  - Installing vlucas/phpdotenv (v1.1.1)
    Downloading: 100%         
    Downloading: 100%         
    Downloading: 100%         
    Failed to download vlucas/phpdotenv from dist: The "https://api.github.com/repos/vlucas/phpdotenv/zipball/0cac554ce06277e33ddf9f0b7ade4b8bbf2af3fa" 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
    Now trying to download from source
  - Installing vlucas/phpdotenv (v1.1.1)
    Cloning 0cac554ce06277e33ddf9f0b7ade4b8bbf2af3fa
  - Installing symfony/var-dumper (v2.7.3)
    Downloading: 100%         
    Downloading: 100%         
    Downloading: 100%         
    Failed to download symfony/var-dumper from dist: The "https://api.github.com/repos/symfony/var-dumper/zipball/e8903ebba5eb019f5886ffce739ea9e3b7519579" 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
    Now trying to download from source
  - Installing symfony/var-dumper (v2.7.3)
    Cloning e8903ebba5eb019f5886ffce739ea9e3b7519579
  - Installing symfony/translation (v2.7.3)
    Downloading: 100%         
    Downloading: 100%         
    Downloading: 100%         
    Failed to download symfony/translation from dist: The "https://api.github.com/repos/symfony/Translation/zipball/c8dc34cc936152c609cdd722af317e4239d10dd6" 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
    Now trying to download from source
  - Installing symfony/translation (v2.7.3)
    Cloning c8dc34cc936152c609cdd722af317e4239d10dd6
  - Installing symfony/routing (v2.7.3)
    Downloading: 100%         
    Downloading: 100%         
    Downloading: 100%         
    Failed to download symfony/routing from dist: The "https://api.github.com/repos/symfony/Routing/zipball/ea9134f277162b02e5f80ac058b75a77637b0d26" 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
    Now trying to download from source
  - Installing symfony/routing (v2.7.3)
    Cloning ea9134f277162b02e5f80ac058b75a77637b0d26

所以,首先它说它没能做什么,但后来它说安装、克隆等。我检查了文件夹your-project-name,它有大约190MB的东西。那么它起作用了吗?如果没有,我该如何解决此问题?

我正在运行OS X Mavericks和PHP 5.6+

我看了其他答案,但似乎没有一个对我的系统有效。

我通过自制软件安装openssl:

brew install openssl

这会将openssl证书安装到/usr/local/etc/openssl/cert.pem,因此我们现在可以使用新的PHP 5.6 INI设置openssl.cafile来告诉PHP在哪里可以找到证书:

添加

openssl.cafile=/usr/local/etc/openssl/cert.pem

试试这个

composer create-project laravel/laravel c:/xampp/htdocs/laravel

-这里的路径是(c:\examplep/htdocs/laravel(,所以请将其更改为您的路径。

-如果不起作用,那么你必须重新安装ca cert包,它会解决了问题!

相关内容

  • 没有找到相关文章

最新更新