Latest LQ Deal: Linux Power User Bundle
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 01-22-2007, 03:55 PM   #1
LQ Newbie
Registered: Oct 2005
Posts: 10

Rep: Reputation: 0
running command as apache

I am using ezpublish on a dedicated Plesk server runing RHEL and Apache2. The CMS requires access to the imagemagick executable called "convert". I can run convert as any user I log in as by typing convert -v but when I try to call convert from a web page via php exec I get an error.

As far as I can tell the problem is that the apache user does not have permission to call an executable on the system. php is not in safe maode and openbasedir is also off.

Any suggestions on how I could get this working?

Thank in advance.
Old 01-24-2007, 01:47 AM   #2
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
If you are running PHP in safe_mode then PHP will only allow you to run binaries listed in the safe_mode-exec_dir variable. Usually I create a special directory and put binaries I want PHP to be able to execute in there so I don't have to allow PHP to execute everything in /usr/bin. The settings are stored in /etc/php.ini on my CentOS system.

If you are running SELinux that might also come into play. It is only an option on RHEL 4 though so if you are using 3 you don't need to worry about that. I'm not an SELinux export so I couldn't tell you how to make it allow it, but check for denied messages from it in /var/log/messages to see if it's part of the problem.
Old 01-29-2007, 10:25 AM   #3
LQ Newbie
Registered: Oct 2005
Posts: 10

Original Poster
Rep: Reputation: 0
As I said php was not in safe_mode.

I chowned the convert binary to the apache group and everything is behaving now.



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
Failed to start apache : Apache does not appear to be running : number11 Slackware 9 02-11-2005 10:51 AM
sh command running as nobody chongluo Linux - Security 1 12-01-2004 07:03 AM
running shell command with apache didi86 Linux - Software 4 11-28-2004 05:02 PM
Running a command from anywhere tez Linux - Newbie 5 02-27-2004 11:07 PM
command running on cd in Daem0hn Linux - General 3 07-22-2003 04:13 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:38 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