Re: Execute shell script from PHP
| From: | Jason Wong | Date: | Tue, 18 Jan 2005 16:48:51 +0000 |
| Subject: | Re: Execute shell script from PHP | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-206655@lists.php.net to get a copy of this message | ||
On Tuesday 18 January 2005 18:59, Tom wrote:
> Khan wrote:
> > Tom wrote:
> >> shell_exec()
> >
> > yes, I have try that but nothing happenes. here is my code. Is this
> > correct?
> >
> > <?php
> > shell_exec('/test/acct.sh');
> > ?>
Note that shell_exec() expects a filesystem path and not your webserver's
document root.
> looks fine to me, except that I tend to run a check to make sure that it
> has run ok, like
> $myReturn = shell_exec('/test/acct.sh');
> or
> if (shell_exec('/test/acct.sh');
Note also that if command executes correctly without error then 0 is returned
and non-zero in case of errors.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
New Year Resolution: Ignore top posted posts