Re: Execute shell script from PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux