Re: passthru gives error in httpd/error_log
| From: | Tom Rogers | Date: | Fri, 21 Nov 2003 01:05:41 +0000 |
| Subject: | Re: passthru gives error in httpd/error_log | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-170514@lists.php.net to get a copy of this message | ||
Hi,
Friday, November 21, 2003, 10:53:08 AM, you wrote:
JH> I'm trying to run a super simple command through passthru.
JH> Here's my test.php file:
JH> <html><body>
JH> <? passthru('ls -l'); ?>
JH> </body></html>
JH> It works if run directly with "php test.php".
JH> When this is run from the browser, there is no output, and the
JH> following error is logged in /var/log/httpd/error_log :
JH> sh: /ls: No such file or directory
JH> What does this mean ? Any command I try instead of "ls -l",
JH> gives a similar error.
JH> The funky thing is that it HAS worked, but now it doesn't, and
JH> I have no idea what happened.
JH> Any clues and hints are much appreciated.
JH> /Jesper
You probably have to put the full path to ls
<? passthru('/bin/ls -l'); ?>
--
regards,
Tom