php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
php composer-setup.php
移动 composer.phar,这样 composer 就可以进行全局调用:
mv composer.phar /usr/local/bin/composer
切换为国内镜像:
composer config -g repo.packagist composer https://packagist.phpcomposer.com
更新 composer:
composer selfupdate
PS:
安装laravel项目报出这个错误,查询得知没有安装php的fileinfo.so扩展
MissingDependencyException in ImageManager.php line 133:PHP Fileinfo extension must be installed
我用的事lnmp安装包,找到lnmp1.4/src/php-5.6.31解压tar -jxvf php-5.6.31.tar.bz2
然后cd lnmp1.4/src/php-5.6.31/ext/fileinfo
/usr/local/php/bin/phpize,得到数据
./configure -with-php-config=/usr/local/php/bin/php-config
make && make install
find /usr/local/php -nam php.ini
添加上extension=fileinfo.so 保存
重启就可以了。
———————
作者:lengyue1084
来源:CSDN
原文:https://blog.csdn.net/lengyue1084/article/details/79575761
版权声明:本文为博主原创文章,转载请附上博文链接!
2019/11/06:
如果出现
[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:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
windows下请设置全量国内源:
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/,