Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


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

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


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.


Old 08-20-2008, 08:00 AM   #2
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, 11:00 AM   #3
LQ Newbie
Registered: Feb 2008
Posts: 11

Original Poster
Rep: Reputation: 0

thanks for the reply

redhat enterprise server 5.2 tikanga
apache 2.2.3
php 5
Old 08-21-2008, 07:30 AM   #4
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:

Also see:

Hope this helps.

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


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 08:01 AM
bash: Permission Denied Panagiotis_IOA Slackware 5 11-07-2006 10:25 PM
bash: /etc/profile: Permission denied Zero-0-Effect Linux - General 3 03-28-2005 04:47 AM
bash: /etc/profile: Permission denied madmax Linux - General 15 07-20-2003 06:56 AM
RH7.2 bash: permission denied Korshun Linux - Distributions 3 04-29-2002 10:22 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:09 AM.

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