
How do I run shell script from PHP
Quote:
> No go
> chown apache on.sh
> chgrp apache on.sh
> tail -f error_log
> Error: Couldn't get the port at 378
> Error: Couldn't get the port at 378
> Error: Couldn't get the port at 378
> Error: Couldn't get the port at 378
> Error: Couldn't get the port at 378
> Error: Couldn't get the port at 378
> Error: Couldn't get the port at 378
>>> Can someone tell me why this does not go ?
>>> /usr/local/apache/htdocs/test.php
>>> <?
>>> echo "sending\n";
>>> exec("./on.sh");
>>> exec("exit(0)");
>>> ?>
>>> /usr/local/apache/htdocs/on.sh
>>> #!/bin/bash
>>> ./lptout 2
>>> -rwxrwxrwx 1 root root 23 Feb 13 00:41 on.sh
>>> -rwxrwxrwx 1 root root 12284 Feb 13 00:21 lptout
>>> But "./on.sh" works from the command line
>> Try shell_exec(". /usr/local/apache/htdocs/on.sh");
on.sh is world executable, so it shouldn't matter who the owner is. Have
you tried 'su'ing to apache?
Regards,
David
--
David Jonathan Grant
http://www.davidjonathangrant.info/