php composer openssl错误 [英] Php composer openssl error
问题描述
在问之前,我不得不说我已经尝试了这里所有类似的问题,但都失败了.
Before asking, i have to say that I have tried every similar question here on stack and elsewhere and failed.
由于此错误,我无法使用composer
:
I am unable to use composer
because of this error:
requires ext-openssl * -> the requested PHP extension openssl is missing from your system.
我在ubuntu
上有xampp
.
我尝试过的事情:
- 我没有评论
php.ini
中的;extension=php_openssl.dll
(cli和normal)-没用 - 通过php之外的终端安装了openssl-无法正常工作
- 检入
phpinfo()
是否已加载并激活openssl
- I have uncommented
;extension=php_openssl.dll
inphp.ini
(both cli and normal) - did not work - Installed openssl through terminal outside of php - did not work
- Check in
phpinfo()
ifopenssl
is loaded and activated
- 还有其他一些事情,例如通过
php -c /opt/lampp/etc/php.ini composer.phar install
在出现错误的地方运行作曲家
- and few more like runing composer through
php -c /opt/lampp/etc/php.ini composer.phar install
where i get error
PHP Warning: PHP Startup: Unable to load dynamic library /usr/include/php5/ext/php_openssl.so - /usr/include/php5/ext/php_openssl.so: cannot open shared object file: No such file or directory in Unknown on line 0
- 我试图在
bashrc
中更改PATH
,也没有成功
- I have tried to change
PATH
inbashrc
, no success either
我发现奇怪的是扩展的位置...
What i have found strange is the location of extensions...
在phpinfo()
中,扩展名dir是/usr/include/php5/ext/
,即使我尝试在php.ini
中指定另一个dir,并且当然重新启动apache仍未在phpinfo()
中显示.
In phpinfo()
extension dir is /usr/include/php5/ext/
even though I have tried to specify another dir in php.ini
and of course restart apache and still didnt show in phpinfo()
.
但是在php-config
命令中,我得到扩展目录为/usr/local/lib/php/extensions/no-debug-non-zts-20100525
But in php-config
command I get that extension dir is /usr/local/lib/php/extensions/no-debug-non-zts-20100525
我不确定系统上是否有多个php,但我尝试查找php.ini文件,但只有2个出现.
I'm not sure if i have multiple php on system but I tried to look for php.ini files and only 2 came up.
/etc/php5/cli/php.ini
/opt/lampp/etc/php.ini
推荐答案
我更喜欢安装 LAMP 堆栈与xamp: 这是简单易用的配置包...
I prefer install LAMP stack vs. xamp: it is simple and easy config package ...
sudo apt-get install apache2
sudo apt-get install curl php5-cli php5 libapache2-mod-php5 php5-openssl
sudo /etc/init.d/apache2 restart
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
要测试安装,请运行:
composer
使用此命令不需要更改php.ini等.
with this command not required changed php.ini and etc.
这篇关于php composer openssl错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!