Re: shell script not working with shell_exec
| From: | Scott Fletcher | Date: | Thu, 14 Aug 2003 13:03:01 +0000 |
| Subject: | Re: shell script not working with shell_exec | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-159565@lists.php.net to get a copy of this message | ||
It doesn't really do you much by changing the file permission and ownership
to Apache. By the way, it would be nobody:nobody when it come to Apache,
not apache:apache.
What you will need to do is to login using the Apache account from the
terminal login and execute the command line code. If it doesn't work then
you know the problem had nothing to do with Apache and PHP.
Also, some php exec() function sometime require the prefix before it. Like
putting in environment variables or something to make it work, such as
putenv() for example. This depend on the situation.
Scott F.
"Chris Overman" <sh298470@12move.nl> wrote in message
news:20030814075650.73569.qmail@pb1.pair.com...
> Hi,
> I have a shell script which works when executed from the command line, but
> doesn't when executed from PHP with shell_exec. Of course I realize that
in
> the former case I am 'root' and in the latter 'apache', so I changed every
> involved file to have the owner:group apache:apache and also the
permissions
> on the directories. Without success ...
>
> There are two commands:
> shell_exec("/root/MBROLA/txt2pho/d/txt2pho/txt2pho <
> /var/www/html/museum/audio/TTS_1.txt >
> /var/www/html/museum/audio/TTS_1.pho");
>
> shell_exec("/root/MBROLA/mbrola-linux-i386 /root/MBROLA/voices/d/de3/de3
> /var/www/html/museum/audio/TTS_1.pho
/var/www/html/museum/audio/TTS_1.wav");
>
> As I installed the txt2pho and mbrola packages under uid root, there are
> probably 2 options left:
> 1. reinstall these packages under uid apache (? - how can I login as
apache
> ?)
> 2. change the shell_exec uid from apache to root (? - dangerous probably,
I
> read something about using sudo ?)
>
> I'm quite stuck now how to proceed.
>
> Any help is welcome,
> Chris.
>
>