解壓php
tar -vjxf php-7.2.5.tar.bz2
configurevim
./configure --prefix=yourpath
yum install gcc
yum install libxml2-devel
yourpath/bin/php -m
,若是能看到php的擴展,說明安裝成功vim ~/.bash_profile
alias php=yourpath/bin/php
source ~/.bash_profile
php -i | grep php.ini
,能夠看到php.ini默認放在yourpath/lib目錄下/opt/download/php-7.2.5
/opt/soft/php
/opt/soft/php/lib
進入openssl的擴展目錄bash
cd /opt/download/php-7.2.5/ext/openssl
運行phpizephp7
/opt/soft/php/bin/phpize
若是出現Cannot find config.m4.報錯,則composer
cp config0.m4 config.m4
執行安裝curl
./configure --with-openssl --with-php-config=/opt/soft/php/bin/php-config
make && make install
安裝完成後,會提示在某個目錄生成.so文件,個人生成位置是url
/opt/soft/php/lib/php/extensions/no-debug-non-zts-20170718/
打開php.ini,添加如下兩行.net
extension_dir = "/opt/soft/php/lib/php/extensions/no-debug-non-zts-20170718/"
extension=openssl.so
將composer.phar下載到項目中debug
curl -sS https://getcomposer.org/installer | php
若是把composer.phar放在系統的 PATH 目錄中,就能在全局訪問composer.pharcode
mv composer.phar /usr/local/bin/composer