LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 08-19-2008, 04:29 PM   #1
helsing
LQ Newbie
 
Registered: Feb 2008
Posts: 11

Rep: Reputation: 0
Calling a bash script from PHP - permission denied


Hi,

I want to call a bash script from PHP/Apache/RedHat that is located in the /bin using php exec().

I can do this on my Debian box running Apache as system user. I try to run apache as a system user on RedHat but I get the permission denied error. Am I on the right track and/or should I put the bash script in a directory other than /bin.


Cheers.



Steve
 
Old 08-20-2008, 09:00 AM   #2
codenjanod
Member
 
Registered: Oct 2006
Posts: 38

Rep: Reputation: 15
Which version of Redhat/Apache/PHP ?

Are there any clues in the logs?

Also check if SELinux is enabled, could cause permission problems.

See config file in /etc/selinux/config
If it is set to "enforcing" change it to disabled and reboot your machine.
 
Old 08-20-2008, 12:00 PM   #3
helsing
LQ Newbie
 
Registered: Feb 2008
Posts: 11

Original Poster
Rep: Reputation: 0
hi,

thanks for the reply

using
redhat enterprise server 5.2 tikanga
apache 2.2.3
php 5
 
Old 08-21-2008, 08:30 AM   #4
codenjanod
Member
 
Registered: Oct 2006
Posts: 38

Rep: Reputation: 15
Are you running the script from the web page on your client machine, or from command line on the server?
Did you check the settings for SELinux?
Anything in the logs?

Make sure the file extension of the script file is .php

If for the command line, see: http://www.modwest.com/help/kb5-125.html

Also see: http://www.webmasterworld.com/forum88/981.htm

Hope this helps.

Last edited by codenjanod; 08-21-2008 at 08:39 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling perl script and passing variable from php script hosea Programming 5 10-21-2008 09:01 AM
bash: Permission Denied Panagiotis_IOA Slackware 5 11-07-2006 11:25 PM
bash: /etc/profile: Permission denied Zero-0-Effect Linux - General 3 03-28-2005 05:47 AM
bash: /etc/profile: Permission denied madmax Linux - General 15 07-20-2003 07:56 AM
RH7.2 bash: permission denied Korshun Linux - Distributions 3 04-29-2002 11:22 AM


All times are GMT -5. The time now is 06:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration