问题描述
这是我的伺服器设定:
- CentOS 6.5版(最终版)
- PHP 5.5 .7
- pecl_http 2.0.4 stable
- 服务器版本:Apache / 2.2.15(Unix)
我有一切正常运行,除非我试图加载 pecl_http
模块它给我以下警告, 't load:
PHP警告:PHP启动:无法加载动态库'/ path / to / php / modules / http .so' - /path/to/php/modules/http.so:未定义的符号:php_persistent_handle_abandon在未知的行0
我试着去无处不在,但没有运气。安装似乎很好,但我不知道有什么问题。
我来这里有同样的问题 - 无法得到2.0.4的工作 - 希望帮助你或其他人在这里,我邀请您查看我的答案在 serverfault
为方便起见,我也将其复制到下面:
我没有设置问题 - 至少不是我的知识。我运行nginx + php5-fpm。我的php.ini文件被正确配置,所有我的其他扩展正常工作 - 测试它与phpinfo()或php --ini。
我的问题pecl_http(HttpRequest )是扩展的版本(2.0.4)。通过在命令行中运行来检查您的版本
pecl list
我无法获得pecl_http-2.0.4工作,但我可以运行
pecl uninstall pecl_http
然后
pecl install pecl_http-1.7.6
。
重新启动php5-fpm和我的网络服务器(nginx)后,一切正常工作!
EXTRA HELP:
- 和pear已安装 - 您可能想要运行这两个命令,假设您在fpm中使用php.ini或您可以写根据您的配置的路径:
pear config-set php_ini /etc/php5/fpm/php.ini
pecl config-set php_ini /etc/php5/fpm/php.ini
这使得pecl知道你正在使用web服务器使用哪个php.ini文件,并将添加extension = http .so在正确的位置。这帮助我,所以也许它也会帮助你!
This is my server configuration:
- CentOS release 6.5 (Final)
- PHP 5.5.7
- pecl_http 2.0.4 stable
- Server version: Apache/2.2.15 (Unix)
I have everything up and running except when I tried to load the pecl_http
module it gives me the following warning and it won't load:
PHP Warning: PHP Startup: Unable to load dynamic library '/path/to/php/modules/http.so' - /path/to/php/modules/http.so: undefined symbol: php_persistent_handle_abandon in Unknown on line 0
I tried to look everywhere but without a luck. The install seems fine but I don't know what's wrong with it.
解决方案
I came here with the same problem - I couldn't get 2.0.4 to work - in hopes of helping you or others that stumble here, I invite you to check out my answer on serverfault here.
For your convenience I've also copied it below:
I didn't have a setup problem - at least not to my knowledge. I am running nginx + php5-fpm. My php.ini file was correctly configured and all my other extensions were working properly - test it with phpinfo() or php --ini.
My problem with pecl_http (HttpRequest) was the extension's version (2.0.4). Check your version by running in the command line
pecl list
I was unable to get pecl_http-2.0.4 to work, but I was able to run
pecl uninstall pecl_http
then
pecl install pecl_http-1.7.6
. Make sure you have libcurl installed as well or you might experience install failures.
After restarting php5-fpm and my webserver (nginx) everything was working prefectly!
EXTRA HELP:
Before you install - and pear is installed - you may want to run these two commands assuming you are using the php.ini in fpm - or you can write the path according to your configuration:
pear config-set php_ini /etc/php5/fpm/php.ini
pecl config-set php_ini /etc/php5/fpm/php.ini
This makes it so that pecl knows which php.ini file you are using with your web-server and will add the extension=http.so in the correct spot. This helped me so maybe it'll help you too!
这篇关于pecl_http加载失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!