Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"zip I/O error: Permission denied" with exec command

Tags:

php

zip

exec

I'm trying to recursively zip a directory with the exec command, first of all I do not need the zipArchive class for outline reasons however when I pass this command in the exec command I get an error saying:

zip I/O error: Permission denied

For this command:

cd ../../; zip -P temppassword html/acp/backup/filename.zip -r html/ 2>&1

It starts out in the script located /var/www/html/acp/config.php and it will move to the www directory after cd ../../, then zip up the html directory and store the zip file into /var/www/html/acp/backup/ directory. But unfortunately I get a permission error. How can I allow the command to pass through with "permission"?

like image 756
MacMac Avatar asked Jul 07 '11 16:07

MacMac


1 Answers

Could be either:

  1. The web server user ID doesn't have permission to write out the .zip you're generating
  2. The web server user ID doesn't have permission to read a file/directory somewhere in the area you're zipping up.
like image 176
Marc B Avatar answered Nov 17 '22 20:11

Marc B