addressalign-toparrow-leftarrow-leftarrow-right-10x10arrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcredit-cardcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobe--smallglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1languagelaunch-new-window--smalllight-bulblightning-boltlinklocation-pinlockm-swarmSearchmailmediummessagesminusmobilemoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstar-shapestartickettrashtriangle-downtriangle-uptwitteruserwarningyahooyoutube

Re: [baltimorephp] PHP calling unzip

From: Kevin S.
Sent on: Tuesday, March 20, 2012, 3:48 PM
I'm guessing that its the ~/ziptest.zip that's the problem.  Apache is likely running as a different user than your shell and "~" means the current user's home directory.
Kevin


From: Joe Tseng <[address removed]>
To: [address removed]
Sent: Tuesday, March 20,[masked]:40 PM
Subject: [baltimorephp] PHP calling unzip

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




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Joe Tseng ([address removed]) from Baltimore PHP.
To learn more about Joe Tseng, visit his/her member profile
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]


People in this
group are also in: