Exit status 11: What does it mean?
I have a PHP CLI script ( http://codepad.org/w6iyLLdv ) which stubbornly returns exit code 11, des开发者_开发百科pite the exit(0)
and the lack of any apparent problem.
Advanced Bash-Scripting Guide: Appendix E. Exit Codes With Special Meanings lists nothing special about 11, and Google finds nothing about it in general nor specifically related to PHP - except possibly Are there any standard exit status codes in Linux?.
Of course I can check for an exit status of 0 or 11 in my calling code, but that's dirty.
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.
Note: After I posted this, I started getting a PHP-Warning from imagick about no permissions to create the ~/.gnome2 directory, and the 11 status. So seeing the 0 status after applying this fix may have been a fluke.
Is it exiting with exit code 11, or signal 11? If it's the latter, it's crashing with a SIGSEGV.
Otherwise, see if you can figure out which line it is exiting on. For example, insert exit(0);
after the 10th line, and if it exits with 0 instead of 11 move the exit(0) down a bit. That will at least give us something more to work with.
精彩评论