红联Linux门户
Linux帮助

linux安装composer提示If possible you should enable it or

发布时间:2017-02-18 09:29:33来源:linux网站作者:ipuppy
在安装 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$
 
本文永久更新地址:http://www.linuxdiyf.com/linux/28499.html