Re: [PHP] exec command fails in php, works in the command line

2005-09-21 Thread ernst
yeah, if you look at the thread you will see that I've already done this. On Wed, 21 Sep 2005, adriano ghezzi wrote: did you tried to run the script from the shell as www-data user ? (if not su www-data) an then run the script may be something regarding permission hth 2005/9/21, John Nichel

Re: [PHP] exec command fails in php, works in the command line

2005-09-21 Thread adriano ghezzi
did you tried to run the script from the shell as www-data user ? (if not su www-data) an then run the script may be something regarding permission hth 2005/9/21, John Nichel <[EMAIL PROTECTED]>: > [EMAIL PROTECTED] wrote: > > I have two programs on two servers, and they both have similar proble

Re: [PHP] exec command fails in php, works in the command line

2005-09-21 Thread ernst
php places uploaded files in the /tmp directory with a unique name, and when I copy them to my directory, I also guarantee a unique name for them. I have verified that this is all working. I've patched this with a cron job that runs every minute, but it really should happen in php, so that the

Re: [PHP] exec command fails in php, works in the command line

2005-09-21 Thread rouvas
I am assuming that you get hold of the file through uploading it, correct? So, when it fails maybe another upload (i.e. script invocation) is happening and the previous file gets lost/corrupted/whatever. Try to move the file to another dir (maybe /tmp) with a random name and see what happens. An

Re: [PHP] exec command fails in php, works in the command line

2005-09-21 Thread ernst
Yes, but that's been done. Since these are shared servers, on one I am logged in as the user the web server is running as, on the other I can't su to nobody, but were there permissions errors, I would have been able to capture them. If permissions caused this, it would fail every time, since

Re: [PHP] exec command fails in php, works in the command line

2005-09-21 Thread Rasmus Lerdorf
[EMAIL PROTECTED] wrote: > You're telling me. That's why I think php or apache kills it. I didn't really follow this, but typically you can debug exec problems from the command line by switching to the web server user id and running the exact same command. -Rasmus -- PHP General Mailing List (

Re: [PHP] exec command fails in php, works in the command line

2005-09-21 Thread ernst
You're telling me. That's why I think php or apache kills it. On Wed, 21 Sep 2005, John Nichel wrote: [EMAIL PROTECTED] wrote: convert doesn't produce any output regardless of whether it works or not. Ecasound produces output when it works, but when it doesn't, it produces no output. Using

Re: [PHP] exec command fails in php, works in the command line

2005-09-21 Thread John Nichel
[EMAIL PROTECTED] wrote: convert doesn't produce any output regardless of whether it works or not. Ecasound produces output when it works, but when it doesn't, it produces no output. Using php tricks to capture standard error also produces no output. Hopefully somebody else on the list can h

Re: [PHP] exec command fails in php, works in the command line

2005-09-21 Thread ernst
convert doesn't produce any output regardless of whether it works or not. Ecasound produces output when it works, but when it doesn't, it produces no output. Using php tricks to capture standard error also produces no output. On Wed, 21 Sep 2005, John Nichel wrote: [EMAIL PROTECTED] wrot

Re: [PHP] exec command fails in php, works in the command line

2005-09-21 Thread John Nichel
[EMAIL PROTECTED] wrote: as I said, the default timout is 300 seconds, a lot longer than my program takes to run, and I am pretty certain that if timeout were triggered, I'd see it in the client. Yeah, I'm using a browser on the php page, and everything seems to function fine from the browser

Re: [PHP] exec command fails in php, works in the command line

2005-09-21 Thread ernst
as I said, the default timout is 300 seconds, a lot longer than my program takes to run, and I am pretty certain that if timeout were triggered, I'd see it in the client. Yeah, I'm using a browser on the php page, and everything seems to function fine from the browser to the server, it's after

Re: [PHP] exec command fails in php, works in the command line

2005-09-21 Thread John Nichel
[EMAIL PROTECTED] wrote: timeout isn't being used on either of these machines, and as far as I read it, the timeout directive would make the web server fail, producing an apache error or some strange behaviour on the client end. Neither of How is timeout _not_ being used? It's a core directi

Re: [PHP] exec command fails in php, works in the command line

2005-09-21 Thread ernst
timeout isn't being used on either of these machines, and as far as I read it, the timeout directive would make the web server fail, producing an apache error or some strange behaviour on the client end. Neither of these happens, the php script completes normally, but the exec command (and onl

Re: [PHP] exec command fails in php, works in the command line

2005-09-21 Thread John Nichel
[EMAIL PROTECTED] wrote: the logs say things like: /kunden/homepages/12/d117065027/htdocs/software/ImageMagick-6.2.3/utilities/convert ib_images/Other_Spices_Basic_004.jpg -resize 180x120 ib_images/Other_Spices_Basic_004_thumb.jpg this is a command I'm trying to get php to run. I then cut an

Re: [PHP] exec command fails in php, works in the command line

2005-09-21 Thread ernst
the logs say things like: /kunden/homepages/12/d117065027/htdocs/software/ImageMagick-6.2.3/utilities/convert ib_images/Other_Spices_Basic_004.jpg -resize 180x120 ib_images/Other_Spices_Basic_004_thumb.jpg this is a command I'm trying to get php to run. I then cut and paste it to the command

Re: [PHP] exec command fails in php, works in the command line

2005-09-21 Thread John Nichel
[EMAIL PROTECTED] wrote: If the web server didn't have permission to execute the app, it would NEVER execute the app, not execute it some of the time. In fact, it ALWAYS executes the app, it just doesn't always allow it to finish. I log all attempts to run these apps in order to debug, so I k

Re: [PHP] exec command fails in php, works in the command line

2005-09-21 Thread ernst
If the web server didn't have permission to execute the app, it would NEVER execute the app, not execute it some of the time. In fact, it ALWAYS executes the app, it just doesn't always allow it to finish. I log all attempts to run these apps in order to debug, so I know that the command as p

Re: [PHP] exec command fails in php, works in the command line

2005-09-21 Thread John Nichel
[EMAIL PROTECTED] wrote: I don't want to crowd the list up with dead ends, so I was trying to respond only to you. You'll get more chances at finding the solution to this with the list's eyes on it rather than just myself. Plus, it provides an archive of the problem and the (if we find it)

Re: [PHP] exec command fails in php, works in the command line

2005-09-21 Thread ernst
I don't want to crowd the list up with dead ends, so I was trying to respond only to you. I'm not calling a php program from exec, I'm calling ecasound and convert. For example, in the php code: exec("convert $internalpath/$filename -resize {$thumbWidth}x{$thumbHeight} $internalpath/$thumbn

Re: [PHP] exec command fails in php, works in the command line

2005-09-21 Thread John Nichel
Please reply to the list. [EMAIL PROTECTED] wrote: No, all of these things your are bringing up would cause the programs to NEVER work, not work some of the time or when the data they are processing is small. Depends on the install. My cli uses a different php.ini than the web one. Did you

Re: [PHP] exec command fails in php, works in the command line

2005-09-21 Thread John Nichel
[EMAIL PROTECTED] wrote: I have two programs on two servers, and they both have similar problems. In each one, I use 'exec' to call a helper program. In one case, it is ecasound, which I use to resample an mp3. In the other, it is convert, which creates a thumbnail of a very large image the u

Re: [PHP] exec command fails in php, works in the command line

2005-09-21 Thread John Nichel
[EMAIL PROTECTED] wrote: I have two programs on two servers, and they both have similar problems. In each one, I use 'exec' to call a helper program. In one case, it is ecasound, which I use to resample an mp3. In the other, it is convert, which creates a thumbnail of a very large image the u

[PHP] exec command fails in php, works in the command line

2005-09-21 Thread ernst
I have two programs on two servers, and they both have similar problems. In each one, I use 'exec' to call a helper program. In one case, it is ecasound, which I use to resample an mp3. In the other, it is convert, which creates a thumbnail of a very large image the user has uploaded. In bot