I'm trying to extract a zip archive in a docker container app running Laravel 9 on PHP 8.1.7, and i'm facing a weird error.
So if a try this code in a controller
$zip = new ZipArchive();
$result = $zip->open("/var/www/html/public/my_archive.zip");
if ($result === TRUE) {
$zip->extractTo("/var/www/html/public/my_folder");
}
$zip->close();
the files in archive are correctly extracted, but return this error:
ErrorException ZipArchive::extractTo(/var/www/html/public/my_folder/my_file.xml): Operation failed: Operation not permitted
If I run the same code in php artisan tinker it works.
Anyone have some idea to fix this problem?
It don't seem a permissions related problem, the folder is created with 777 permission and the files are copied correctly.
EDIT
root@5899a5badc45:/var/www/html/public/my_folder# ls -lhart *
-rwxrwxrwx 1 1000 1000 1.3K Oct 25 12:24 phpunit.xml
Thanks