How do I install a PHP extension? Print

  • 33

The recommended way to install a PHP extension is using PECL, here is an example. Run the following commands:

  1. pecl download memcache
  2. tar -xzf memcache-X.X.X.tgz
  3. cd memcache-X.X.X
  4. phpize
  5. ./configure
  6. 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.


Was this answer helpful?

« Back