PHP calling unzip

From: Joe Tseng
Sent on: Wednesday, March 14, 2012 11:28 AM
All,

Boss asked me to figure this out and now we're both stumped.  I wrote a little test script to see if we can use PHP to unzip a file:

$ more ziptest.php
<?
echo("Start here");
exec("unzip ~/ziptest.zip", $aOutput);

echo("[".$aOutput[0]."]");
echo("end here");
?>

It works great at the command line - it extracts the file and gives me stdout:

$ php -f ziptest.php
Start here[Archive:  /home/user/ziptest.zip]end here

But it's not doing squat via Apache:

Start here[]end here

And no we're not using the zip module.  Our SAMP stack has to be built by hand from source code and I don't have the time right now to do that to add this functionality to PHP.  I've also verified that the directory the script lives in has rw perms for the Apache daemon user.

Can I assume I'm really close and it's some tiny detail I'm overlooking?

Thx in advance,

 - Joe



If you type "Google" into Google, you can break the Internet.  -- Jen Barber

Our Sponsors

People in this
Meetup are also in:

Log in

Not registered with us yet?

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy