沃梦达 / 编程问答 / php问题 / 正文

pecl_http 加载失败

pecl_http failed to load(pecl_http 加载失败)

本文介绍了pecl_http 加载失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的服务器配置:

  • CentOS 6.5 版(最终版)
  • PHP 5.5.7
  • pecl_http 2.0.4 稳定版
  • 服务器版本:Apache/2.2.15 (Unix)

除了我尝试加载 pecl_http 模块时,我已经启动并运行了所有东西,它给了我以下警告并且它不会加载:

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.

推荐答案

我带着同样的问题来到这里 - 我无法让 2.0.4 工作 - 希望帮助你或其他在这里绊倒的人,我邀请你在 serverfault here 上查看我的答案.

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:

我没有设置问题 - 至少据我所知没有.我正在运行 nginx + php5-fpm.我的 php.ini 文件配置正确,所有其他扩展都正常工作 - 使用 phpinfo() 或 php --ini 测试它.

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.

pecl_http (HttpRequest) 的问题是扩展的版本 (2.0.4).通过在命令行中运行来检查您的版本

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

我无法让 pecl_http-2.0.4 工作,但我能够运行

I was unable to get pecl_http-2.0.4 to work, but I was able to run

pecl 卸载 pecl_http

然后

pecl 安装 pecl_http-1.7.6.确保您也安装了 libcurl,否则您可能会遇到安装失败.

pecl install pecl_http-1.7.6. Make sure you have libcurl installed as well or you might experience install failures.

重启 php5-fpm 和我的网络服务器 (nginx) 后一切正常!

After restarting php5-fpm and my webserver (nginx) everything was working prefectly!

额外帮助:

在安装之前 - 并且 pear 已安装 - 您可能想要运行这两个命令,假设您在 fpm 中使用 php.ini - 或者您可以根据您的配置编写路径:

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

这样 pecl 就可以知道您在 Web 服务器上使用的是哪个 php.ini 文件,并且会在正确的位置添加 extension=http.so.这对我有帮助,所以也许它也会对你有所帮助!

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 加载失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:pecl_http 加载失败

基础教程推荐