Linux Permissions Issue
Posted on 2006-11-26
A little background first...
I have a PHP script that needs to invoke a C program on the same Linux machine. In order to test the exec() in the script, I created a C program that accepts arguments and prints them to a dummy file. I did the CHMOD 777 deal on both the program and the dummy file prior to running the script. Here's an example of the script:
exec('/home/my/directory/structure/ ./test blah blah blah');
This didn't work, I assumed because the user trying to call the program is APACHE, but when I typed the above directly into the command line from a different directory within the same shell, I received a "permission denied" message. So, it appears that the program can only be run from within the same directory. This sucks.
So, how can I overcome this permissions issue? Is there a simple solution?