Exit status 11 in exec'd CLI script

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Jesdisciple
Posts: 10
Joined: 2011-03-11T14:26:57-07:00
Authentication code: 8675308

Exit status 11 in exec'd CLI script

Post by Jesdisciple »

I need to thumb images in a separate process while the server sends an HTTP response, so I'm exec'ing a PHP CLI script. When the script is run directly by CLI, it works fine; but when I exec it, Imagick forces the exit status to 11 despite my exit(0). The latest point at which I can exit to prevent the 11 status is just before flattenImages is called.

PHP CLI source: http://codepad.org/WTHOiWw0 (designed for execution either as ordinary PHP or via CLI)
example CLI invocation: php -f lib/php/thumb_test.php -- img=om3e2a
issue history: http://stackoverflow.com/questions/5255 ... es-it-mean

I tried to minimize that test-case by taking out all the validation and database interaction, but when I tried the 11 status left.

Thanks for any help.
Last edited by Jesdisciple on 2011-03-11T17:35:25-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Exit status 11 in exec'd CLI script

Post by fmw42 »

Not that I can help much. But it looks to me that you are using Imagick rather than PHP exec. Do I misunderstand? Why do you have to flatten the image right after creating it? Does it have multiple frames/layers?
Jesdisciple
Posts: 10
Joined: 2011-03-11T14:26:57-07:00
Authentication code: 8675308

Re: Exit status 11 in exec'd CLI script

Post by Jesdisciple »

That script is being invoked by exec'ing the given CLI invocation. Some images (example: an animated GIF, the one I discovered this with) have multiple layers, so I figured it would be best to flatten just in case. The 11 status is returned consistently, regardless of layers or no layers.

Significantly, the image is produced successfully and direct invocation via terminal returns exit status 0.
Jesdisciple
Posts: 10
Joined: 2011-03-11T14:26:57-07:00
Authentication code: 8675308

Re: Exit status 11 in exec'd CLI script

Post by Jesdisciple »

I finally thought to check Apache's error.log, and the 11 status was accompanied by this: PHP Warning: Module 'imagick' already loaded in Unknown on line 0

I found the solution here: http://www.somacon.com/p520.php Apparently I accidentally put an extra << extension="imagick.so" >> line in php.ini. Removing it allowed the CLI script to return status 0.
Post Reply