Install php extension on AMPPS

Guillermo Teixeira picture Guillermo Teixeira · Jun 25, 2018 · Viewed 8k times · Source

As the title says im trying to install a php extension (zip.so) that is missing from php7.1 version in ampps 3.8. I have searched for an answer but no luck so far.

Also using php5.6 and going to the php extensions list im able to see the zip extension, but since the software that im trying to intstall requires php 7.X im unable to simply use php5.6.

Thanks for the help in advance.

Answer

Guillermo Teixeira picture Guillermo Teixeira · Jun 25, 2018

I finally found a way to do it:

  1. Go to (for example) https://pecl.php.net/ and download the extension that you need.
  2. Unzip the extension and go to the file location $ cd my/extension
  3. Run phpize /usr/local/ampps/php-7.1/bin/phpize
  4. Next run ./configure --with-php-config=/path/to/my/php-config for example ./configure --with-php-config=/usr/local/ampps/php-7.1/bin/php-config
  5. make and sudo make install
  6. In the end of sudo make install log you will find this Installing shared extensions: /usr/local/ampps/php-7.1/lib/extensions/no-debug-non-zts-20160303/ file path.
  7. Go to the file path and you will find your compiled extension, for me it was zip.so
  8. Finally copy the extension into your php folder /usr/local/ampps/php-7.1/lib/extensions/ext and you will be able to see it on the list of extensions in ampps, dont forget to enable it and restart apache2!

Hope it helps!