LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   running command as apache (https://www.linuxquestions.org/questions/linux-server-73/running-command-as-apache-521797/)

wardjame 01-22-2007 02:55 PM

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.

btmiller 01-24-2007 12:47 AM

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.

wardjame 01-29-2007 09:25 AM

As I said php was not in safe_mode.

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

Thanks.


All times are GMT -5. The time now is 04:11 PM.