The Little Guy Posted May 27, 2008 Share Posted May 27, 2008 For some reason, this isn't unzipping the value of $location when It gets to this point is: /home/brend123/hostbox.us/subdomains/test/test.zip Is there an extra step I need to do, or is there something wrong? (I have had it working before on a different project in the past) Code: if($_POST['unzip']==1){ $location = '/home/brend123/hostbox.us/subdomains/'.$subName.'/'.$_GET['dr'].'/'.$filename; $location = str_replace('//','/',$location); exec("unzip '$location'",$arr); unlink($location); } Link to comment https://forums.phpfreaks.com/topic/107467-unzip-a-file/ Share on other sites More sharing options...
trq Posted May 27, 2008 Share Posted May 27, 2008 Is unzip installed? Link to comment https://forums.phpfreaks.com/topic/107467-unzip-a-file/#findComment-550832 Share on other sites More sharing options...
The Little Guy Posted May 27, 2008 Author Share Posted May 27, 2008 it should be, because I am on the same server that I unzipped other files before. Link to comment https://forums.phpfreaks.com/topic/107467-unzip-a-file/#findComment-550833 Share on other sites More sharing options...
trq Posted May 27, 2008 Share Posted May 27, 2008 So what does the $arr array say? You really should be using the full path to unzip too, it may not be in your path. eg; exec("/usr/bin/unzip '$location'",$arr); Link to comment https://forums.phpfreaks.com/topic/107467-unzip-a-file/#findComment-550846 Share on other sites More sharing options...
The Little Guy Posted May 27, 2008 Author Share Posted May 27, 2008 $arr says: Array ( [0] => Archive: /home/brend123/hostbox.us/subdomains/test/test.zip ) Link to comment https://forums.phpfreaks.com/topic/107467-unzip-a-file/#findComment-550880 Share on other sites More sharing options...
The Little Guy Posted May 27, 2008 Author Share Posted May 27, 2008 SSH output: /usr/bin/unzip /home/brend123/hostbox.us/subdomains/test/test.zip Archive: /home/brend123/hostbox.us/subdomains/test/test.zip extracting: hello.html inflating: Uptodateonline.html.url Link to comment https://forums.phpfreaks.com/topic/107467-unzip-a-file/#findComment-550888 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.