0

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?

6
  • Which Plesk, OS and PHP version have you installed on your server? Commented Feb 25, 2013 at 8:13
  • OS is Linux 2.6.32-042stab072.10, PLESK is 10.4.4 Update #47 and PHP is 5.3.21 Commented Feb 25, 2013 at 8:29
  • and what is your linux distro name and version? Commented Feb 26, 2013 at 3:32
  • I have build pecl_http and add extension=http.so in /etc/php.d/http.ini. And it looks like everything fine php -r 'var_dump(extension_loaded("http"));' returns bool(true). Does this file exists on your server ls -la /usr/lib64/php/modules/http.so -rwxr-xr-x 1 root root 1642342 Mar 1 08:39 /usr/lib64/php/modules/http.so ? (lib64 - because i have Centos 5.9 x64 ) Commented Mar 1, 2013 at 2:41
  • What happens if change enable_dl = Off to enable_dl = On in php.ini and run php -r "dl('http.so');" ? Commented Mar 1, 2013 at 2:49

1 Answer 1

1

What happens if change

enable_dl = Off 

to

enable_dl = On 

in php.ini and run

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

?

Sign up to request clarification or add additional context in comments.

2 Comments

I have this exact problem on CentOS, followed all the instructions above and php -r "dl('http.so');" returns this PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/http.so' - /usr/lib64/php/modules/http.so: undefined symbol: php_json_decode in Unknow n on line 0 Also, php -me does not have http included.
Your issue is not related to this question. Is php-json package is installed on server?(rpm -qa | grep -e php.*json)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.