ImageMagick: proc_open() has been disabled for security reasons

soupp - March 23, 2009 - 17:45
Project:ImageAPI
Version:6.x-1.5
Component:ImageAPI Imagick
Category:support request
Priority:normal
Assigned:buntstich
Status:closed
Description

I have toe following problem but not how to address it. Or if it is a bug.

The error log shows: proc_open() has been disabled for security reasons in /home/httpd/vhosts/..../httpdocs/sites/all/modules/imageapi/imageapi_imagemagick.module on line 196.

I can "successfully" chose a path in ImageMagick settings but no version info is shown (unlike on other host). No "path not exist" error either.

I digged a bit with hosting company so they enabled something for me and mentioned that ImageMagick is fully accessible via system/exec().

Now I'm a bit lost what to do.

#1

soupp - March 23, 2009 - 18:12

Oh, sorry originally it was line 194 (just played a bit with code).

proc_open() has been disabled for security reasons in /home/httpd/vhosts/.../httpdocs/sites/all/modules/imageapi/imageapi_imagemagick.module on line 194.

#2

drewish - March 23, 2009 - 18:52
Status:active» fixed

we're using proc_open() rather than exec() because proc_open lets us get error and output back. exec() only gives the output making it harder to debug problems. i can't understand their line of reasoning that calls exec() safe but proc_open() unsafe.

if someone wants to roll a patch to add a fallback mode to use exec() when proc_open() isn't available i'd be interested in reviewing it but otherwise i'm going to leave this as is.

#3

System Message - April 6, 2009 - 19:00
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

#4

suityou01 - May 11, 2009 - 19:58

Erm, it doesn't work for me. Exec has less arguments than proc_open so I am confused. This is really stopping me in my tracks using Ubercart, and I need to crack on. Can someone please advise what to do here? Paste some code perhaps?

[Quote]
if ($h = proc_open($convert_path .' '. $command_args, $descriptors, $pipes, $_SERVER['DOCUMENT_ROOT'])) {
[/Quote]

This is the line that is breaking.

#5

turco - June 27, 2009 - 22:08

I experienced the same problem. No solution?

#6

buntstich - July 5, 2009 - 11:05
Assigned to:Anonymous» buntstich

To do — please;-)

#7

Roi Danton - September 3, 2009 - 13:20

If your host has installed FastCGI you could use this mode to access proc_open(). Add the following line to .htaccess:
AddHandler php-fastcgi .php .php4

#8

dankoB - October 5, 2009 - 12:32

I have the same problem. I thought it went away when I enabled the Transliteration module, but evidently not. Sent a support request to my hosting provider and their response was:
"This function is disabled on our shared servers for security reasons. You will need to use an alternative method if the particular script you are using requires that function." FastCGI is not available on my server. Any other solutions?

 
 

Drupal is a registered trademark of Dries Buytaert.