spatie / laravel-backup

A package to backup your Laravel app

Home Page:https://spatie.be/docs/laravel-backup

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Class "ZipArchive" not found

holyboly opened this issue · comments

Version: spatie/laravel-backup 8.6.0

Happened after composer update to the newest version.

/vendor/spatie/laravel-backup/config/backup.php

'compression_method' => ZipArchive::CM_DEFAULT,

Exception:

[2024-02-16 12:41:50] local.ERROR: Class "ZipArchive" not found {"exception":"[object] (Error(code: 0): Class \"ZipArchive\" not found at /project_dir/vendor/spatie/laravel-backup/config/backup.php:128)
[stacktrace]
#0 /project_dir/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php(138): require()
#1 /project_dir/vendor/spatie/laravel-package-tools/src/PackageServiceProvider.php(33): Illuminate\\Support\\ServiceProvider->mergeConfigFrom()
#2 /project_dir/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(788): Spatie\\LaravelPackageTools\\PackageServiceProvider->register()
#3 /project_dir/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php(75): Illuminate\\Foundation\\Application->register()
#4 /project_dir/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(765): Illuminate\\Foundation\\ProviderRepository->load()
#5 /project_dir/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterProviders.php(17): Illuminate\\Foundation\\Application->registerConfiguredProviders()
#6 /project_dir/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(263): Illuminate\\Foundation\\Bootstrap\\RegisterProviders->bootstrap()
#7 /project_dir/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(447): Illuminate\\Foundation\\Application->bootstrapWith()
#8 /project_dir/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(199): Illuminate\\Foundation\\Console\\Kernel->bootstrap()
#9 Command line code(1): Illuminate\\Foundation\\Console\\Kernel->handle()
#10 {main}
"} 

Do you have the zip extension available?

Yes, this code runs without problems:

Artisan::command('dev:test', function () {
    $zip = new \ZipArchive();
    $this->info('no error');
});