php cannot load pecl http extension

南笙酒味 提交于 2019-12-11 14:06:35

问题


I have installed pecl_http on a PLESK server (which seems to be successful) but for some reason, the http extension will not load into PHP.

var_dump(extension_loaded("http"));

gives me bool(false).

pecl info pecl_http gives me a lot of info and if I run php -me http is also listed.

php -i | grep "http_request" gives me:

http_request => N/A => 0 => 0
http_request_datashare => GLOBAL => 1 => 0
http_request_pool => N/A  => 0 => 0

and if I run pecl run-tests -p pecl_http I get a lot of FAILs

and I am also getting

Fatal error: Call to undefined function http_get()

http.so is located inside /usr/lib/php/modules/ which is also defined as the extension dir in php.ini - all other extensions loads fine.

What have I missed?


回答1:


What happens if change

enable_dl = Off 

to

enable_dl = On 

in php.ini and run

php -r "dl('http.so');" 

?



来源:https://stackoverflow.com/questions/15061813/php-cannot-load-pecl-http-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!