Solved

Linux Permissions Issue

Posted on 2006-11-26
3
353 Views
Last Modified: 2013-12-16
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?  

Jason
0
Comment
Question by:cdromes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 125 total points
ID: 18017617
Did you mean
exec('/home/my/directory/structure/test blah blah blah');
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 18017652
Ia lready stated in php TA.
chmod +x /home/my/directory/structure/executeable.exe /home/my/directory/structure /home/my/directory /home/my
if the exec is a script, then also
chmod +r /home/my/directory/structure/executeable.exe

Also verify, that php is not running in safe_mode with safe_mode_exec_dir set.
0
 

Author Comment

by:cdromes
ID: 18017824
That was it exactly, ozo.  Thanks.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question