linux 安装 composer 提示 "If possible you should enable it or recompile php with --with-openssl"

在安装 composer 的时候( 我的系统是 ubuntu ), 出现了 "

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

" 这样的错误, 从最后一行可以看出,就是在编译 php 的时候,没有把 --witch-openssl 加上( 我的 php 是自己编译的 )

既然这样,我就重新编译一次 php, 在重新编译 php 的时候,记得 把之前的参数加上, 可以通过 phpinfo(); 来查看上一次编译时的参数, 

上面是我已经编译后的了,其实还缺很多;

下面就狠一点,把常用的都加上

~/soft/php-5.6.5$ sudo ./configure --prefix=/usr/local/php --enable-fpm \

> --with-zlib \

> --enable-inline-optimization \

> --disable-debug \

> --disable-rpath \

> --enable-shared \

> --enable-opcache \

> --with-fpm-user=www \

> --with-fpm-group=www \

> --with-mysql=mysqlnd \

> --with-mysqli=mysqlnd \

> --with-pdo-mysql=mysqlnd \

> --with-gettext \

> --enable-mbstring \

> --with-iconv \

> --with-mcrypt \

> --with-mhash \

> --with-openssl \

> --enable-bcmath \

> --enable-soap \

> --with-libxml-dir \

> --enable-pcntl \

> --enable-shmop \

> --enable-sysvmsg \

> --enable-sysvsem \

> --enable-sysvshm \

> --enable-sockets \

> --with-curl \

> --with-zlib \

> --enable-zip \

> --with-bz2 \

> --with-readline



编译过程中发现的错误1:

configure: error: Please reinstall the BZip2 distribution


解决方法:

 sudo apt-get libbz2-dev


错误2:

这个是说 curl 的,错误的信息弄丢了;

解决:

sudo apt-get install libcurl4-gnutls-dev


错误3:

configure: error: Please reinstall readline - I cannot find readline.h


解决:

sudo apt-get install libreadline-dev


这样就编译成功了,在编译的时候,可能还会提示其它的错误, 安装对应的包就可以了( 我的是这样的 );


安装 composer:

puppy@puppy:~/soft$ sudo curl -sS https://getcomposer.org/installer | sudo php 

-d detect_unicode=Off

[sudo] puppy 的密码: 

All settings correct for using Composer

Downloading...


Composer (version 1.3.2) successfully installed to: /home/puppy/soft/composer.phar

Use it: php composer.phar


puppy@puppy:~/soft$




============= 说的不好的,还希望大家多多体谅,谢谢 ================







  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值