Reply to Re: Some commands execute via PHP "system", some don't--why?

Your name:

Reply:


Posted by petersprc on 11/18/06 23:56

Hi,

Maybe stderr has additional info? Maybe this can get more info:

exec('/dir/to/file/convert.pl 2>&1', $output, $exitCode);

if ($exitCode != 0) {
trigger_error("Command failed with exit code $exitCode: \"" .
join("\n", $output) . "\".");
}

Acrobatic wrote:
> Hello
>
> I've got a simple Perl script that works fine from the command line but
> not from PHP via the browser. It's a conversion program that converts
> an image to a different format, and writes the new image to a
> directory.
>
> I'm running as user "nobody" and have the target directory set to
> "nobody:nobody", and I've tried chmodding the directory to both 755 and
> 777 with no luck. If I run my script from the command line, it executes
> with no problems. In PHP, I'm using
> "system('/dir/to/file/convert.pl',$retval)", but the file doesn't get
> created.
>
> $retval returns a 0, so I'm assuming that's a good thing.
>
> In my Perl script, I added a generic "print "Hello, World"" to it, and
> $retval then returns "Hello World0", so I know the script is at least
> doing something.
>
> Any ideas on something I'm missing? Thanks for any help or pointing in
> the right direction

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация