Posts Tagged ‘core dump after PHP5 and php5-extensions recompile (rebuild) from ports on FreeBSD – cause and solution’

core dump after PHP5 and php5-extensions recompile (rebuild) from ports on FreeBSD – cause and solution

Monday, March 14th, 2011

On my FreeBSD 7.2 system where I host few of my small projects. I have been running Apache 2.0.63 with php 5.3.2 for about a year and a half.

I was pretty happy with this configuration just until today, when I decided to play a bit with the elgg social network building free software platform
The elgg’s CAPTCHA feature on my php 5.3.2 installation was not running properly, the picture of the elgg captcha wasn’t appearing.
First I suspected I might be missing the php-gd support in compiled PHP, however after checking up in both phpinfo(); and with pkg_info I’ve figured out I had the php-gd-5.3.2 bsd package properly install.

However after some investigation on the net I’ve figured out my gd package and php5-gd were both lacking a freetype support.
In that situation I took the option to rebuild my php5 and php5-extensions installed from the port tree.

Of course before I can build it properly I had to upgrade a number of bsd tooks like autoconf but anyways as this is not the target of this post I’ll skip that and proceed to the essence.

After being able to properly build the php5 and php5-extensions latest packages from my bsd port tree after a port three upgrade my Apache server and php cli was failing to start with a core dumped message.

That was pretty odd as no error was reported neither in php_error.log nor in my httpd-error.log

As I’ve been through a similar problem some long time ago during my php interpreter compilation I investigation the issue and found out that my /usr/ports/lang/php5 port after compiled with:

freebsd /usr/ports/lang/php5# make install clean

is running fine. The Apache server with a simple php without any extension prooved also to run without the the shitty core dumped fail message.
Therefore in order to find out the exact reason for the core dumped failures after compilation and installation of the /usr/ports/php-extensions I went through manually installing all my selected extensions from that port through the make config command:

After about 40 minutes of manual installation of the complete list of php5 modules which I need for my proper website operations I’ve figured out that after installing the php5-recode port the php and apache server started immediately crashing with the core dumped

As php5-recode wasn’t that necessary for my proper php operation I decided to remove this module and my PHP enpowered Webserver was back to normal.

The complete list of extensions which I’ve installed next to the php5 port on my FreeBSD are:

freebsd /root# pkg_info |grep php5-
php5-bz2-5.3.5 The bz2 shared extension for php
php5-ctype-5.3.5 The ctype shared extension for php
php5-dom-5.3.5 The dom shared extension for php
php5-fileinfo-5.3.5 The fileinfo shared extension for php
php5-ftp-5.3.5 The ftp shared extension for php
php5-gd-5.3.5 The gd shared extension for php
php5-gettext-5.3.5 The gettext shared extension for php
php5-gmp-5.3.5 The gmp shared extension for php
php5-hash-5.3.5 The hash shared extension for php
php5-iconv-5.3.5 The iconv shared extension for php
php5-imap-5.3.5 The imap shared extension for php
php5-json-5.3.5 The json shared extension for php
php5-mcrypt-5.3.5 The mcrypt shared extension for php
php5-mysql-5.3.5 The mysql shared extension for php
php5-pcntl-5.3.5 The pcntl shared extension for php
php5-posix-5.3.5 The posix shared extension for php
php5-pspell-5.3.5 The pspell shared extension for php
php5-readline-5.3.5 The readline shared extension for php
php5-session-5.3.5 The session shared extension for php
php5-shmop-5.3.5 The shmop shared extension for php
php5-soap-5.3.5 The soap shared extension for php
php5-sockets-5.3.5 The sockets shared extension for php
php5-sqlite-5.3.5 The sqlite shared extension for php
php5-sysvshm-5.3.5 The sysvshm shared extension for php
php5-tidy-5.3.5 The tidy shared extension for php
php5-tokenizer-5.3.5 The tokenizer shared extension for php
php5-wddx-5.3.5 The wddx shared extension for php
php5-xml-5.3.5 The xml shared extension for php
php5-xmlreader-5.3.5 The xmlreader shared extension for php
php5-xmlrpc-5.3.5 The xmlrpc shared extension for php
php5-xmlwriter-5.3.5 The xmlwriter shared extension for php
php5-xsl-5.3.5 The xsl shared extension for php
php5-zip-5.3.5 The zip shared extension for php
php5-zlib-5.3.5 The zlib shared extension for php

The above php5 extensions list will most likely work well right after installation just like in my case in other systems as well, so I would suggest you install the same php extensions directly selecting them from /usr/ports/lang/php-extensions via the make config ncurses interface to save yourself some time.