Linux安装composer遇到的坑

红色

执行命令:curl -sS https://getcomposer.org/installer | php
报错如下
Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:

The openssl extension is missing, which means that secure HTTPS transfers are impossible.
If possible you should enable it or recompile php with --with-openssl

没有openssl扩展
cd php7.0/ext/openssl // 进入到openssl文件
phpize // 运行phpize

编译和安装
./configure --with-openssl --with-php-config=/usr/local/php/bin/php-config // 编译和安装
遇到报错:
configure: error: Cannot find OpenSSL's <evp.h>

缺少openssl相关的库,直接安装即可
yum install openssl openssl-devel
遇到“configure: error: mcrypt.h not found. Please reinstall libmcrypt”
提示比较明确,缺少libmcrypt,直接安装即可
yum install libmcrypt
最后执行 make && make install
进入最后提示的目录 cp openssl.so /usr/local/php/include/php/ext
找到php.ini,在最后面添加如下内容: extension=openssl.so
重启 后查看扩展: php -m

最后
mv composer.phar /usr/local/bin/composer

转载于:https://www.cnblogs.com/greycdoer0/p/10844197.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值