Hi folks,
After working on this for 3 hours, I've decided to bite the bullet and ask for help.
I've got a file that I'm uploading through a form - the file is called myfile.zip. For what it's worth, it was created on Mac OSX using the "Make an Archive" option.
I know that it's a valid ZIP format because when I'm in the shell, I can type:
And voila, it's unzipped. No complaints from the server.
But when I use PHP to do this -
- well, it dies.
2 questions:
1. WTF? I don't think it's a permissions thing because Apache (nobody) has write access to the tempfiles dir (it's chmod'ed 777 to remove that variable):
Anyone else have any idea why PHP won't unzip the file?
2. I simply LOVE the mysql_error() function - is there an equivalent for filesystem errors? (I tried using trigger_error(E_USER_ERROR) and was underwhelmed by the information it provided.)
Thanks for your help. There are so many knowledgeable and creative people on this list.
Inger
After working on this for 3 hours, I've decided to bite the bullet and ask for help.
I've got a file that I'm uploading through a form - the file is called myfile.zip. For what it's worth, it was created on Mac OSX using the "Make an Archive" option.
I know that it's a valid ZIP format because when I'm in the shell, I can type:
Code:
/usr/[URL unfurl="true"]www/users/inger/admin/%[/URL] unzip myfile.zip
And voila, it's unzipped. No complaints from the server.
But when I use PHP to do this -
Code:
chdir ("/usr/[URL unfurl="true"]www/users/inger/admin/tempfiles/");[/URL]
chmod ("myfile.zip", 0755);
shell_exec("unzip myfile.zip") or die("couldn't unzip file!");
- well, it dies.
2 questions:
1. WTF? I don't think it's a permissions thing because Apache (nobody) has write access to the tempfiles dir (it's chmod'ed 777 to remove that variable):
Code:
% ls -ld /usr/[URL unfurl="true"]www/users/inger/admin/tempfiles[/URL]
drwxrwxrwx 2 inger users 512 Apr 27 15:54 .
Anyone else have any idea why PHP won't unzip the file?
2. I simply LOVE the mysql_error() function - is there an equivalent for filesystem errors? (I tried using trigger_error(E_USER_ERROR) and was underwhelmed by the information it provided.)
Thanks for your help. There are so many knowledgeable and creative people on this list.
Inger