Posts Tagged ‘Apache / PHP Segmentation fault after plesk upgrade’

Apache / PHP Segmentation fault after plesk upgrade

I could see that php had crashed

-bash-3.2# php -m
PHP Warning:  Module ‘ionCube Loader’ already loaded in Unknown on line 0
The ionCube PHP Loader is disabled because of startup problems.
PHP Warning:  Module ‘Zend Optimizer’ already loaded in Unknown on line 0
PHP Warning:  Zend Optimizer: module registration failed! in Unknown on line 0
Segmentation fault

=================================================================================================
httpd error logs

-bash-3.2# tail -f /var/log/httpd/error_log
[Sat Dec 26 06:22:10 2009] [notice] child pid 3528 exit signal Segmentation fault (11)
[Sat Dec 26 06:22:10 2009] [notice] child pid 3641 exit signal Segmentation fault (11)
[Sat Dec 26 06:22:10 2009] [notice] child pid 3950 exit signal Segmentation fault (11)
[Sat Dec 26 06:22:10 2009] [notice] child pid 3951 exit signal Segmentation fault (11)
[Sat Dec 26 06:22:10 2009] [notice] child pid 3987 exit signal Segmentation fault (11)
[Sat Dec 26 06:22:12 2009] [notice] child pid 3988 exit signal Segmentation fault (11)
[Sat Dec 26 06:22:12 2009] [notice] child pid 3989 exit signal Segmentation fault (11)
[Sat Dec 26 06:22:12 2009] [notice] child pid 3990 exit signal Segmentation fault (11)
[Sat Dec 26 06:22:13 2009] [notice] child pid 4003 exit signal Segmentation fault (11)
[Sat Dec 26 06:22:13 2009] [notice] child pid 4004 exit signal Segmentation fault (11)
[Sat Dec 26 06:22:16 2009] [notice] child pid 4005 exit signal Segmentation fault (11)
[Sat Dec 26 06:22:21 2009] [notice] child pid 4008 exit signal Segmentation fault (11)
[Sat Dec 26 06:22:21 2009] [notice] child pid 4009 exit signal Segmentation fault (11)
[Sat Dec 26 06:22:21 2009] [notice] child pid 4010 exit signal Segmentation fault (11)
[Sat Dec 26 06:22:22 2009] [notice] child pid 4011 exit signal Segmentation fault (11)
[Sat Dec 26 06:22:26 2009] [notice] child pid 4037 exit signal Segmentation fault (11)
[Sat Dec 26 06:22:26 2009] [notice] child pid 4038 exit signal Segmentation fault (11)
[Sat Dec 26 06:22:26 2009] [notice] child pid 4039 exit signal Segmentation fault (11)
[Sat Dec 26 06:22:26 2009] [notice] child pid 4040 exit signal Segmentation fault (11)
[Sat Dec 26 06:22:29 2009] [notice] child pid 4042 exit signal Segmentation fault (11)
[Sat Dec 26 06:22:29 2009] [notice] child pid 4043 exit signal Segmentation fault (11)
[Sat Dec 26 06:22:29 2009] [notice] child pid 4044 exit signal Segmentation fault (11)
[Sat Dec 26 06:22:30 2009] [notice] child pid 4045 exit signal Segmentation fault (11)
[Sat Dec 26 06:22:46 2009] [notice] child pid 4046 exit signal Segmentation fault (11)
[Sat Dec 26 06:22:46 2009] [notice] child pid 4047 exit signal Segmentation fault (11)

==================================================
-bash-3.2# grep -iR ioncube /etc/php*
/etc/php.d/ioncube-loader.ini:zend_extension=/usr/lib/php/modules//php_ioncube_loader_lin_5.2.so
/etc/php.ini:zend_extension = /usr/local/ioncube/ioncube_loader_lin_5.2.so
/etc/php.ini.rpmsave:zend_extension = /usr/local/ioncube/ioncube_loader_lin_5.2.so
/etc/php.ini-zend_optimizer.bak:zend_extension = /usr/local/ioncube/ioncube_loader_lin_5.1.so
===================================================

I renamed the file  ioncube-loader.ini located in /etc/php.d

Then restarted httpd and checked again

====================
-bash-3.2# php -v
PHP 5.2.9 (cli) (built: Mar 10 2009 16:42:52)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
with the ionCube PHP Loader v3.1.34, Copyright (c) 2002-2009, by ionCube Ltd., and
with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies
====================

I then deleted the file ioncube-loader.in located in /etc/php.d

=====================================================================================================

Apache service fails to start after Plesk or Sitebuilder update via control panel Updater.
Article ID: 1336
Last Review: Oct,6 2008
Author: Vitaly Malakhov
Last updated by: system APPLIES TO:

* Parallels Plesk Panel for Linux/Unix
* Parallels Plesk Sitebuilder for Linux/Unix

Resolution
SYMPTOMS:

Check PHP version and list of enabled modules from root shell, normally these commands should show an output:

# php -v
# php -m

In case of a problem no output is generated or segmentation fault happens.

CAUSE:

PHP IonCube loader extension is included several times or not in proper order.

RESOLUTION:

Find all IonCube loader entries in PHP configuration .ini files with command:

# grep -iR ioncube /etc/php*

Make sure that:
1) only one IonCube loader is included,
2) it corresponds with your PHP version, you can comment out all IonCube entries and check PHP version with `php -v`.
3) it is included before all other Zend extensions.
=================================================================================================