PHP Command Line Segmentation fault

I just had this problem with my FreeBSD server, so I thought it was worth noting down. Upgraded PHP via ports and noticed that every time I ran a PHP script from the command line it core dumped with a segmentation fault. Even running php -v was enough to do it.

Turned out to be a problem with the order in which external modules were being loaded. There is a file called extensions.ini which on FreeBSD lives in /usr/local/etc/php/ which contains all the modules to load. I played around firstly by removing them one at a time until PHP didn’t core dump, thus locating the one that was causing a problem, then re-ordered.

In my case it was the spellchecker stuff that needed moving to the end of the order list, your system is likely to be different.

EDIT [09-05-2010] :- Just came across this blog entry from someone who had similar problems and wrote a small re-ordering script to try to solve it:

Written on 25 Jan 2009 and categorised in FreeBSD and PHP, tagged as CoreDump

Home, Post archive

site copyright Eric Freeman

Valid XHTML 1.0 Strict