Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't get http to work in php

I keep getting this error:

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/http.so' - /usr/lib64/php/modules/http.so: undefined symbol: php_persistent_handle_abandon in Unknown on line 0

PHP Fatal error: Class 'HttpResponse' not found in /var/www/api/init.php on line 4

I've reinstalled http through pecl a few times, even tried installing it from the tar.gz. I'm running an EC2 instance.

I HAVE put extension=http.so in my php.ini.

like image 878
Robby Grodin Avatar asked Feb 27 '14 20:02

Robby Grodin


2 Answers

You probably got version 2 of pecl_http, and it has some new requirements. See the installation instructions. For me these lines worked:

extension=raphf.so
extension=propro.so
extension=http.so

Edit: Order matters, so first try the same order as I used.

I also made sure http.so is loaded after json.so and the other prerequisites.

like image 76
Leif Arne Storset Avatar answered Sep 19 '22 07:09

Leif Arne Storset


I installed pecl_http successfully with following steps on Debian

  1. execute sudo pecl install raphf propro pecl_http
  2. create /etc/php5/mods-available/zhttp.ini extension=raphf.so extension=propro.so extension=http.so
  3. execute sudo php5enmod zhttp
  4. restart your web server
like image 23
Peter Chung Avatar answered Sep 19 '22 07:09

Peter Chung