Urgent! Problem with passthru, system, exec...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
slimsam1
Forum Commoner
Posts: 49
Joined: Wed Aug 21, 2002 12:20 am

Urgent! Problem with passthru, system, exec...

Post by slimsam1 »

Ok, here's the source for my file, written from scratch:

http://houstonhardwoods.guardianhosting.net/image.phps

It's not creating the thumbnails.

Here's a section of it:

Code: Select all

        //passthru("convert $im -sample 231x231 -border 1x1 -bordercolor black $thumbfile");
        //$blah = passthru("convert -scale 50%x50% ".$im." ".$thumbfile);
        //$blah = passthru("convert -size 231x231 ".$im." -resize 231x231 -bordercolor black -border 0x0 +profile '*' ".$thumbfile);
        //$blah = "/bin/sh `convert -size 231x231 ".$im." -resize 231x231 -bordercolor black -border 0x0 +profile '*' ".$thumbfile."`";
        //$blah = "convert ".$im."  -resize 231x231 ".$thumbfile;
        $blah = "cp ".$im." ".$thumbfile;
        //copy($im,$thumbfile);
        //$blah = "mogrify -geometry 231x231 -quality 75 ".$thumbfile;
        passthru($blah);
The passthru using "cp" works, indicating that the permissions are all good.

The convert ".$im."  -resize 231x231 ".$thumbfile one works when I paste it into ssh and run it. So, basically

convert works.
passthru works.
passthru + convert does not work.

Any idea what it could be??
Thank you!
slimsam1
Forum Commoner
Posts: 49
Joined: Wed Aug 21, 2002 12:20 am

Post by slimsam1 »

By the way, it gets this error in browser output:

<br>
<b>Warning</b>: readfile("/hsphere/local/home/houstonh/houstonhardwoods.guardianhosting.net/thumbs/item_images_THUMB_0013.jpg") - No such file or directory in <b>/hsphere/local/home/houstonh/houstonhardwoods.guardianhosting.net/image.php</b> on line <b>59</b><br>
User avatar
enygma
Site Admin
Posts: 175
Joined: Fri Apr 19, 2002 8:29 am
Location: Dallas, Tx

Post by enygma »

then wouldn't you think that it cant find that image file?
seems pretty simple to me...look at the path there and be sure that that's the right image/location.
User avatar
llimllib
Moderator
Posts: 466
Joined: Mon Jul 01, 2002 2:19 pm
Location: Baltimore, MD

Post by llimllib »

And, by the way, posting something as urgent will usually get it ignored. In the future, you'll probably want to avoid that.
slimsam1
Forum Commoner
Posts: 49
Joined: Wed Aug 21, 2002 12:20 am

Post by slimsam1 »

Hey, thanks for the replies...


It turns out that I still have no idea why it didn't work-- but I got it working right using GD. The paths/permissions are good (passthru('cp $im $thumbfile'); worked...)

Thanks anyway...

Mike
Post Reply