Adding the HTTP Extension to PHP on Ubuntu 12.04 LTS

Quite often I forget the requirements of the php_http / pecl_http extension which is required for some network actions. Here is how to install most of what’s required.

apt-get install libcurl3 php5-dev libcurl4-gnutls-dev libmagic-dev
pecl install pecl_http

Then edit the two php.ini files

nano -w /etc/php5/apache2/php.ini
nano -w /etc/php5/cli/php.ini

to include the line

Then restart Apache

/etc/init.d/apache2 restart