how to enable php8.0 ZipArchive on aapanel
Published: 14 Jun, 2023

blog_7614526489171652a80_thumb.png

I've bought this script on codecanyon, let have a look at the documente for installation. 

 

 

System Requirements. 

Shared Hosting, VPS or Dedicated Server

Linux or Windows based machine

Apache / LiteSpeed Web Server

PHP 7.0 or Higher

MySQLi Drivers for PHP

PHP cURL Extension

PHP “fsockopen” Available

PHP ZIP Extension (Optional) , The truth is you must enable it.

BT-Panel is famous in China, so my first tought is installing bt-panel.

But it didn't work, seams laravel(this script base on laravel) can't run on it. I tried another panel too, same problem.

At last i tried aapnel, it work now. But new problem comes, PHP ZIP Extension was required( though their documentation tells me PHP ZIP Extension is Optional).

Now, let me show you how enable ZipArchive on php8.0

 install libzip

yum remove -y libzip

wget https://nih.at/libzip/libzip-1.2.0.tar.gz tar -zxvf libzip-1.2.0.tar.gz cd libzip-1.2.0 ./configure make && make install

When you finished, check if /usr/local/lib/pkgconfig is exist,and set PKG_CONFIG_PATH:

export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"

AAPANEL PHP 8.0 enable PHP ZipArchive

cd /www/server/php/80/src/ext/zip/
/www/server/php/80/bin/phpize
./configure --with-php-config=/www/server/php/80/bin/php-config
make && make install

At the end of  PHP 8.0 php.ini add:

extension = zip.so

At last ,restart php