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 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示