?
Solved

Linux Permissions Issue

Posted on 2006-11-26
3
Medium Priority
?
354 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 500 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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

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…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
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.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month7 days, 19 hours left to enroll

765 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