dos8410 2014-01-12 17:38
浏览 103
已采纳

pecl_http无法加载

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.

  • 写回答

4条回答 默认 最新

  • douyi8408 2014-01-29 21:22
    关注

    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!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值