Solved

Linux Permissions Issue

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
fedora linux on laptop - setup sendmail - or some kind of email 5 64
CentOS 7 Linux for HP DL380 G4 32Bits 7 75
Internal CA server 6 91
postfix start error! 9 51
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
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 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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

761 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