How do I install a PHP extension?

The most commonly used extensions are available in our Centos and Ubuntu repositories.

To install an extension in Centos, follow these steps:

$ yum install php53-soap

In Ubuntu:

$ apt-get install php53-soap

Replace php53 with php54 for PHP 5.4

Other extensions may be installed with PECL.

pecl download memcache
tar -xzf memcache-X.X.X.tgz
cd memcache-X.X.X
phpize
./configure
make && make install

Then you need to enable the extension by adding the configuration to php.ini which usually is located in /usr/local/lib/php.ini

extension=memcache.so

After this, restart Apache either in the control panel or via command line.