Pangurban wrote:
>I have
>Fedora Core 3
>PHP Version 4.3.9
>Apache/2.0.52 (Fedora)
>>Safe Mode is Off
>>A little script using the php exec() function
>>when run as root as in
>[.root at machine]php test.php
>produces the desired result
>>when run as a user
>[user at machine] php test.php
>produces the same result
>>but when run in a browser
>>http://machine/test.php>or
>http://localhost/test.php>>produces the result of the other php commands in test.php
>but not the result of the exec() command
>>>Any ideas anyone?
>>
could be that root and the user have the required command in the $PATH,
but the apache user does not.
try calling the command with the full address
eg:
exec('/usr/bin/du'); instead of exec('du');
also, try using the system() command, and even try using the backticks
(``) method.
Kae
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!