问题
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.
回答1:
I finally found a way to do it:
- Go to (for example) https://pecl.php.net/ and download the extension that you need.
- Unzip the extension and go to the file location
$ cd my/extension
- Run phpize
/usr/local/ampps/php-7.1/bin/phpize
- 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
make
andsudo make install
- In the end of
sudo make install
log you will find thisInstalling shared extensions: /usr/local/ampps/php-7.1/lib/extensions/no-debug-non-zts-20160303/
file path. - Go to the file path and you will find your compiled extension, for me it was
zip.so
- 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!
来源:https://stackoverflow.com/questions/51021800/install-php-extension-on-ampps