|
Posted by Andy Hassall on 10/08/33 11:36
On Fri, 06 Jan 2006 13:36:04 -0600, Good Man <heyho@letsgo.com> wrote:
>Why would the command be working from the
>terminal window but not from the PHP script?
These things are almost always environment differences. Your terminal will be
running under your userid, and have different environment variables to the user
that Apache and hence PHP is running as.
If you run "env" (usually in /usr/bin or /bin) using exec from PHP then you
can get it to dump the environment that will be seen by processes run by exec -
I would bet that there are Java-related environment differences.
But before this, remember there are more arguments to exec:
http://uk.php.net/manual/en/function.exec.php
Check the return value. Check the output. You may also get some useful error
output if you redirect stderr back into stdout (e.g. "your-command 2>&1")
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Navigation:
[Reply to this message]
|