Solved

Linux Permissions Issue

Posted on 2006-11-26
3
350 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
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
curl SSL certificate unable to get local issuer certificate 15 102
CENTOS DHCP Server / PXE/TFTP 14 153
VMware Tools Install On Linux Problem 3 83
LINUX Field Separators 7 34
This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.:

839 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