Re: Execute shell script from PHP

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

 



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');
?>

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');


On some systems you have to execute the script
eg
$myReturn = shell_exec('. /test/acct.sh');

Also make sure that the acct.sh script is executable by the php user
(chmod / chown are your evil friends :) )
Tom

--
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