PHP composer-setup安裝遇到的openssl extension is missing

 問題描述:php

     安裝完成php-7.1.17後,安裝composer出現如下錯誤php7

[root@localhost src]# 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

排查過程當中發現php 配置文件的問題,沒有加載到php.ini文件composer

[root@localhost php]# php --ini
Configuration File (php.ini) Path: /usr/local/php-7.1.17/lib
Loaded Configuration File:         (none)
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)

 建立軟鏈curl

[root@localhost php]# ln -s /home/sc/php/php7-9026.ini /usr/local/php/lib/php.ini

 找到php.ini文件this

[root@localhost lib]# php --ini
Configuration File (php.ini) Path: /usr/local/php-7.1.17/lib
Loaded Configuration File:         /usr/local/php-7.1.17/lib/php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)

再次安裝composer 正常。url

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer

 經過phpinfo 查看是已經加載到了openssl,可是沒有找到php.ini 致使經過絕對路徑時沒有加載到模塊。blog

相關文章
相關標籤/搜索