composer安装laravel时环境变量引起的小错误
在按照官方使用laravel安装器安装laravel时,
composer global require laravel/installer
laravel运行文件没有保存至环境变量$PATH中,所以出现以下错误:
- Installing doctrine/inflector (1.3.1): Cloning ec3a552422 Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+6dc4bfbfa34e+2020-04-22+0211
to retrieve a token. It will be stored in "/root/.composer/auth.json" for future use by Composer. Token (hidden): [Composer\Downloader\TransportException] The "https://api.github.com/" file could not be downloaded: SSL: Success Failed to enable crypto failed to open stream: operation failed
laravel执行文件放在了 /root/.composer/vendor/bin/laravel下,
而Linux的环境变量PATH是/usr/local/bin
所以可以在PATH下创建个软链接至laravel执行文件即可
ln -s /usr/local/bin/larvel /root/.composer/vendor/bin/laravel
浙公网安备 33010602011771号