1、执行命令:
php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
报错:Composer PHP Warning: copy(): SSL operation failed with code 1.
解决方案:
a、访问http://curl.haxx.se/ca/cacert.pem,下载证书文件;
b、将cacert.pem放到自己制定一个安装目录;
c、打开php.ini,去掉openssl.cafile前面的分号, 并修改成:
openssl.cafile=/usr/local/openssl/ssl/certs/cacert.pem
d、重启php服务,或者重启apache;
2、php composer-setup.php;
3、php -r "unlink('composer-setup.php');"
4、重命名:mv composer.phar composer
4、将composer自己指定一个安装目录放进去,并添加到环境变量中;