shell script not working with shell_exec
| From: | Chris Overman | Date: | Thu, 14 Aug 2003 07:57:33 +0000 |
| Subject: | shell script not working with shell_exec | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-159538@lists.php.net to get a copy of this message | ||
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.