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" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> 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.
>
>



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

Reply via email to