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 b开发者_开发百科efore 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: https://stackoverflow.com/questions/5255
I tried to minimize that test-case by taking out all the validation and database interaction, but when I tried the 11 status left.
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.
精彩评论