Connecting Tech Pros Worldwide Help | Site Map

php exec problem with unzip

Newbie
 
Join Date: Nov 2007
Location: www.hrwebdir.org
Posts: 27
#1: Oct 17 '08
I want to upload a zip file and then extract/unzip it. I am accomplishing this with php exec command. I am calling unzip from php exec command within a php script and it is not extracting files. why?
[PHP]<?php
echo exec('unzip file.zip');
?>[/PHP]

i checked apache logs and it says

Quote:
checkdir error: cannot create xtheme-1-1
unable to process xtheme-1-1/comments.php.
checkdir error: cannot create xtheme-1-1
unable to process xtheme-1-1/dbx.css.
It works perfectly fine when i unzip using SSH command line..
how to fix this problem.
ak1dnar's Avatar
Moderator
 
Join Date: Jan 2007
Location: Colombo
Posts: 1,439
#2: Oct 17 '08

re: php exec problem with unzip


Make sure you set the file permissions of that folder to 777 or the lowest allowable for the script to work.
Reply


Similar PHP bytes