Problem on running exec() in Linux
Posted: Tue Jun 10, 2008 12:46 pm
Hi, I have some problem running exec() in php in linux
My scenario as below:
1) I have add JAVA_HOME in etc/profile
2) When I run the exec () in php, the error is
Error: JAVA_HOME is not defined correctly.
We cannot execute java
3) But when I run the same command in command line(root user), the script in the exec() can be run.
4) Found that the user right to run exec() in php is "apache"
Any idea what is the problem? My guess is the apache user didnt run the etc/profile for the environment setup, but I can't find other solutions.
My scenario as below:
1) I have add JAVA_HOME in etc/profile
2) When I run the exec () in php, the error is
Error: JAVA_HOME is not defined correctly.
We cannot execute java
3) But when I run the same command in command line(root user), the script in the exec() can be run.
4) Found that the user right to run exec() in php is "apache"
Any idea what is the problem? My guess is the apache user didnt run the etc/profile for the environment setup, but I can't find other solutions.