LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] PHP Question - exec()

[ILUG] PHP Question - exec()

Kae Verens kae at verens.com
Fri Jun 3 09:04:03 IST 2005


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




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


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!
RSS Version
Powered by Dell