Reply to Re: Trying to execute Java command on server via PHP

Your name:

Reply:


Posted by Andy Hassall on 10/13/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

[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

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