Laravel-backup: Fatal error: Class 'ZipArchive' not found

Created on 4 Mar 2016  路  7Comments  路  Source: spatie/laravel-backup

Hi,

I've deployed a new Forge server yesterday. When I try to run php artisan backup:run I get this message:

Start backing up
Database dumped
Determining which files should be backed up...
Start zipping 31 files...

  [Symfony\Component\Debug\Exception\FatalThrowableError]
  Fatal error: Class 'ZipArchive' not found

It seems like this new Forge server does niet have all required components installed. Any idea's?

Most helpful comment

It isn't installed by default for newly provisioned Forge servers. You can install it by running

sudo apt-get install php7.0-zip

I believe for that it'll be installed by default again soon.

All 7 comments

It isn't installed by default for newly provisioned Forge servers. You can install it by running

sudo apt-get install php7.0-zip

I believe for that it'll be installed by default again soon.

Hello @freekmurze, What does it happen when running sudo apt-get install php7.0-zip on a forge server that's running 5.6.19 ? Thanks.

I guess you should google the specific instructions for installing the zip extension on PHP5.

I had to search here to fix this, it would probably be a good idea to add the extension requirement to the documentation?

Awesome work by the way, those Spatie packages are always a joy to use. 馃憤

@mansouralex I use this command for php5.6, it worked for me
sudo apt-get install php5.6-zip

@redgluten it's mentioned on the requirements page: https://docs.spatie.be/laravel-backup/v4/requirements

First Install PHP Zip Extension Bellow command:

sudo apt-get install php-zip

You are using multiple versions of PHP and you want to link the Zip extension with a specific PHP version.
Here I using the php7.3 version.

sudo apt-get install php7.3-zip

Restart Apache/Nginx Web Server

sudo systemctl restart nginx
sudo systemctl restart apache2

Now Restart PHP-FPM:

sudo systemctl restart php-fpm

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ClickerVinod picture ClickerVinod  路  3Comments

eelcol picture eelcol  路  7Comments

mvdnbrk picture mvdnbrk  路  3Comments

hedii picture hedii  路  5Comments

holymp2006 picture holymp2006  路  4Comments