Solved

Linux Permissions Issue

Posted on 2006-11-26
3
347 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
Comment Utility
Did you mean
exec('/home/my/directory/structure/test blah blah blah');
0
 
LVL 43

Expert Comment

by:ravenpl
Comment Utility
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
Comment Utility
That was it exactly, ozo.  Thanks.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now