# PHP Upgrade Issues



## churchi (Sep 24, 2010)

Hi All,

well i have just spent a few hours trying to get my php to work, and i am at a dead end. i am not sure whats going on.

I have executed an upgrade to apache22 today, however my php seems to be now broken.

When i comment out the line 

```
LoadModule php5_module        libexec/apache22/libphp5.so
```
i can start apache22 now. When i load that module i get this in the error messages:


```
Sep 24 18:02:16 server-01 pid 78315 (httpd), uid 0: exited on signal 11 (core dumped)
Sep 24 18:02:19 server-01 pid 78325 (httpd), uid 0: exited on signal 11 (core dumped)
```

Here is a list of the packages i have installed:

```
[root@server-01 /usr/ports/lang/php5]# pkg_info
OpenSP-1.5.2_2      This package is a collection of SGML/XML tools called OpenS
WWWdb-0.8.3         A Perl based generic WWW DB interface / frontend
adminer-2.3.2       A full-featured MySQL management tool written in PHP
adobe-cmaps-20051217_1 Adobe CMap collection
adodb-5.11          Database library for PHP
amspsfnt-1.0_5      AMSFonts PostScript Fonts (Adobe Type 1 format)
apache-2.2.16_1     Version 2.2.x of Apache web server with prefork MPM.
apr-ipv6-devrandom-gdbm-db42-1.4.2.1.3.9_2 Apache Portability Library
aspell-0.60.6_3     Spelling checker with better suggestion logic than ispell
autoconf-2.67       Automatically configure source code on many Un*x platforms 
autoconf-wrapper-20071109 Wrapper script for GNU autoconf
automake-1.10.3     GNU Standards-compliant Makefile generator (1.10)
automake-1.9.6_4    GNU Standards-compliant Makefile generator (1.9)
automake-wrapper-20071109 Wrapper script for GNU automake
gamin-0.1.10_4      A file and directory monitoring system
gd-2.0.35_7,1       A graphics library for fast creation of images
gdbm-1.8.3_3        The GNU database manager
gettext-0.18.1.1    GNU gettext package
ghostscript8-8.71_6 Ghostscript 8.x PostScript interpreter
gio-fam-backend-2.24.2 FAM backend for GLib's GIO library
glib-2.24.2         Some useful routines of C programming (current stable versi
glitz-0.5.6_2       OpenGL image compositing library
glproto-1.4.11      GLX extension headers
gmake-3.81_4        GNU version of 'make' utility
gmp-5.0.1           A free library for arbitrary precision arithmetic
gnutls-2.8.6_2      GNU Transport Layer Security library
gobject-introspection-0.6.14 Generate interface introspection data for GObject libraries
gpac-libgpac-0.4.5_4,1 Gpac MPEG-4 Systems library and headers
gperf-3.0.3         Generates perfect hash functions for sets of keywords
gsfonts-8.11_5      Standard Fonts for Ghostscript
help2man-1.38.2_1   Automatically generating simple manual pages from program o
html-4.01_2         All W3C published SGML DTDs for HTML
html2text-1.3.2a    Converts HTML documents into plain text
imlib2-1.4.1.000_9,2 The next generation graphics library for Enlightenment
inputproto-2.0      Input extension headers
intltool-0.40.6     Tools to internationalize various kinds of data files
iso8879-1986_2      Character entity sets from ISO 8879:1986 (SGML)
jadetex-3.13_6      A TeX backend for Jade, for typesetting SGML documents
jasper-1.900.1_9    An implementation of the codec specified in the JPEG-2000 s
jbig2dec-0.11       Decoder implementation of the JBIG2 image compression forma
jbigkit-1.6         Lossless compression for bi-level images such as scanned pa
jpeg-8_3            IJG's jpeg compression utilities
kbproto-1.0.4       KB extension headers
lame-3.98.4         Fast MP3 encoder kit
latex-cjk-4.8.2_4   A LaTeX2e macro package which enables the use of CJK script
lzo2-2.03_2         Portable speedy, lossless data compression library
m4-1.4.15,1         GNU m4
makedepend-1.0.2,1  A dependency generator for makefiles
mkfontdir-1.0.5     Create an index of X font files in a directory
mkfontscale-1.0.7   Creates an index of scalable font files for X
mpfr-3.0.0          A library for multiple-precision floating-point computation
mysql-client-5.1.50_1 Multithreaded SQL database (client)
mysql-server-5.1.50 Multithreaded SQL database (server)
nano-2.2.5          Nano's ANOther editor, an enhanced free Pico clone
nasm-2.08.02,1      General-purpose multi-platform x86 and amd64 assembler
net-snmp-5.5_4      An extendable SNMP implementation
netpbm-10.26.64_4   A toolkit for conversion of images between different format
nmap-5.35.d1        Port scanning utility for large networks
nspr-4.8.6          A platform-neutral API for system level and libc like funct
open-motif-2.2.3_6  Motif X11 Toolkit (industry standard GUI (IEEE 1295))
openjade-1.3.3p1_1  Object-oriented SGML/XML parser toolkit and DSSSL engine
openldap-client-2.4.23 Open source LDAP client implementation
openvpn-2.1.3       Secure IP/Ethernet tunnel daemon
orc-0.4.9           Library and toolset to operate arrays of data
p5-Authen-PAM-0.16_1 A Perl interface to the PAM library
p5-Net-SSLeay-1.36  Perl5 interface to SSL
p5-Tk-804.028.502_1 A re-port of a perl5 interface to Tk8.4
p5-XML-Parser-2.36_1 Perl extension interface to James Clark's XML parser, expat
p5-gettext-1.05_3   Message handling functions
p5-type1inst-0.6.1_5 A script that helps install Postscript fonts in X Window Sy
pango-1.28.1        An open-source framework for the layout and rendering of i1
pcre-8.10           Perl Compatible Regular Expressions library
pdflib-7.0.4        A C library for dynamically generating PDF
pecl-fileinfo-1.0.4 A PECL extension to retrieve info about files
pecl-pdflib-2.1.8   A PECL extension to create PDF on the fly
peps-2.0_4          Converts EPS images to anti-aliased bitmaps
perl-5.10.1_2       Practical Extraction and Report Language
php5-5.3.3_2        PHP Scripting Language
php5-bz2-5.3.3_2    The bz2 shared extension for php
php5-ctype-5.3.3_2  The ctype shared extension for php
php5-dom-5.3.3_2    The dom shared extension for php
php5-exif-5.3.3_2   The exif shared extension for php
php5-extensions-1.4 A "meta-port" to install PHP extensions
php5-filter-5.3.3_2 The filter shared extension for php
php5-ftp-5.3.3_2    The ftp shared extension for php
php5-gd-5.3.3_2     The gd shared extension for php
php5-hash-5.3.3_2   The hash shared extension for php
php5-iconv-5.3.3_2  The iconv shared extension for php
php5-imap-5.3.3_2   The imap shared extension for php
php5-json-5.3.3_2   The json shared extension for php
php5-ldap-5.3.3_2   The ldap shared extension for php
php5-mcrypt-5.3.3_2 The mcrypt shared extension for php
php5-mysql-5.3.3_2  The mysql shared extension for php
php5-openssl-5.3.3_2 The openssl shared extension for php
php5-pdo-5.3.3_2    The pdo shared extension for php
php5-pdo_sqlite-5.3.3_2 The pdo_sqlite shared extension for php
php5-posix-5.3.3_2  The posix shared extension for php
php5-pspell-5.3.3_2 The pspell shared extension for php
php5-recode-5.3.3_2 The recode shared extension for php
php5-session-5.3.3_2 The session shared extension for php
php5-simplexml-5.3.3_2 The simplexml shared extension for php
php5-snmp-5.3.3_2   The snmp shared extension for php
php5-soap-5.3.3_2   The soap shared extension for php
php5-sockets-5.3.3_2 The sockets shared extension for php
php5-sqlite-5.3.3_2 The sqlite shared extension for php
php5-tokenizer-5.3.3_2 The tokenizer shared extension for php
php5-xml-5.3.3_2    The xml shared extension for php
php5-xmlreader-5.3.3_2 The xmlreader shared extension for php
php5-xmlwriter-5.3.3_2 The xmlwriter shared extension for php
php5-zip-5.3.3_2    The zip shared extension for php
php5-zlib-5.3.3_2   The zlib shared extension for php
pixman-0.16.6       Low-level pixel manipulation library
pkg-config-0.25_1   A utility to retrieve information about installed libraries
pkg_cutleaves-20090810 Interactive script for deinstalling 'leaf' packages
pkg_tree-1.1_2      Get a 'graphical' tree-overview of installed packages
png-1.4.3           Library for manipulating PNG images
popt-1.16           A getopt(3) like library with a number of enhancements, fro
portaudit-0.5.15    Checks installed ports against a list of security vulnerabi
portdowngrade-0.6_2 Sets a port back to a previous version
portupgrade-2.4.6_4,2 FreeBSD ports/packages administration and management tool s
printproto-1.0.4    Print extension headers
python26-2.6.6      An interpreted object-oriented programming language
recode-3.6_8        Converts files between character sets and usages
renderproto-0.11    RenderProto protocol headers
rrdtool-1.4.4       Round Robin Database Tools
ruby-1.8.7.248_4,1  An object-oriented interpreted scripting language
ruby18-bdb-0.6.5_1  Ruby interface to Sleepycat's Berkeley DB revision 2 or lat
samba-3.0.37_2,1    A free SMB and CIFS client and server for UNIX
schroedinger-1.0.9  High-speed Dirac codec
scr2png-1.2_4       Converts the output of "vidcontrol -p" to PNG
scr2txt-1.2         Converts the output of "vidcontrol -p" to text
screen-4.0.3_8      A multi-screen window manager
smartmontools-5.39.1 S.M.A.R.T. disk monitoring tools
spidermonkey-1.7.0  A standalone JavaScript interpreter from the Mozilla projec
sqlite3-3.7.2       An SQL database engine in a C library
ttf2pt1-3.4.4_2     True Type Font to Postscript Type 1 Converter
unzip-6.0           List, test and extract compressed files in a ZIP archive
webmin-1.520        Web-based interface for system administration for Unix
[root@server-01 /usr/ports/lang/php5]#
```


When i execute php command:

```
[root@server-01 /usr/ports/lang/php5]# php
Segmentation fault: 11 (core dumped)
[root@server-01 /usr/ports/lang/php5]#
```
I have tried to remove all of apache22 and php, however i am still no further than i was a few hours ago.

Can someone please lend me a hand?

let me know what you are after and i will provide it.

cheers.


----------



## Nadja (Sep 24, 2010)

I'm assuming that your problem is caused by a library-problem (because that's usually the problem). After upgrading all your dependencies for PHP vie [CMD=portmaster] -f php5-5.3.3_2[/CMD] you can be sure that all relevant ports are up-do-date and PHP is linked against the correct library. If that  doesn't help, we should start debugging your PHP.


----------



## churchi (Sep 24, 2010)

hey mate,

thanks for the pointers. unfortunately executing the above command still doesn't help. i try and start apache22 with the php module loaded and it won't start. 

is there anything else i can try?

thanks.


```
===>>> Done displaying pkg-message files

===>>> The following actions were performed:
        Re-installation of libtool-2.2.10
        Re-installation of libiconv-1.13.1_1
        Re-installation of gettext-0.18.1.1
        Re-installation of gmake-3.81_4
        Installation of devel/libsigsegv (libsigsegv-2.8)
        Re-installation of m4-1.4.15,1
        Re-installation of perl-5.10.1_2
        Re-installation of p5-gettext-1.05_3
        Re-installation of help2man-1.38.2_1
        Re-installation of autoconf-wrapper-20071109
        Re-installation of autoconf-2.67
        Re-installation of pcre-8.10
        Re-installation of pkg-config-0.25_1
        Re-installation of libxml2-2.7.7
        Re-installation of db42-4.2.52_5
        Re-installation of gdbm-1.8.3_3
        Re-installation of automake-wrapper-20071109
        Re-installation of automake-1.9.6_4
        Re-installation of python26-2.6.6
        Re-installation of expat-2.0.1_1
        Re-installation of apr-ipv6-devrandom-gdbm-db42-1.4.2.1.3.9_2
        Re-installation of apache-2.2.16_1
        Re-installation of php5-5.3.3_2

[root@server-01 /usr/ports/ports-mgmt/portmaster]#
```


----------



## churchi (Sep 24, 2010)

should i be looking to turn on some more logs to see whats actually happening?


```
[root@server-01 /var/log]# tail httpd-error.log 
[Fri Sep 24 18:40:13 2010] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Fri Sep 24 18:40:14 2010] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Fri Sep 24 18:40:14 2010] [notice] Digest: generating secret for digest authentication ...
[Fri Sep 24 18:40:14 2010] [notice] Digest: done
[Fri Sep 24 18:40:15 2010] [notice] Apache/2.2.16 (FreeBSD) mod_ssl/2.2.16 OpenSSL/0.9.8k DAV/2 configured -- resuming normal operations
[Fri Sep 24 18:40:27 2010] [notice] caught SIGTERM, shutting down
[Fri Sep 24 19:20:34 2010] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Fri Sep 24 19:20:35 2010] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Fri Sep 24 19:20:47 2010] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Fri Sep 24 19:20:48 2010] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[root@server-01 /var/log]# tail httpd-access.log 
192.168.0.110 - - [24/Sep/2010:18:37:33 +1000] "GET / HTTP/1.1" 304 - "-" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.10) 
Gecko/20100914 Firefox/3.6.10"
192.168.0.110 - - [24/Sep/2010:18:37:33 +1000] "GET / HTTP/1.1" 304 - "-" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.10) 
Gecko/20100914 Firefox/3.6.10"
192.168.0.110 - - [24/Sep/2010:18:37:33 +1000] "GET / HTTP/1.1" 304 - "-" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.10) 
Gecko/20100914 Firefox/3.6.10"
192.168.0.110 - - [24/Sep/2010:18:37:34 +1000] "GET / HTTP/1.1" 304 - "-" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.10) 
Gecko/20100914 Firefox/3.6.10"
192.168.0.110 - - [24/Sep/2010:18:37:34 +1000] "GET / HTTP/1.1" 304 - "-" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.10) 
Gecko/20100914 Firefox/3.6.10"
192.168.0.110 - - [24/Sep/2010:18:37:34 +1000] "GET / HTTP/1.1" 304 - "-" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.10) 
Gecko/20100914 Firefox/3.6.10"
192.168.0.101 - - [24/Sep/2010:18:37:53 +1000] "GET / HTTP/1.1" 304 - "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100723 
Ubuntu/10.04 (lucid) Firefox/3.6.8"
192.168.0.101 - - [24/Sep/2010:18:40:15 +1000] "GET / HTTP/1.1" 304 - "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100723 
Ubuntu/10.04 (lucid) Firefox/3.6.8"
192.168.0.101 - - [24/Sep/2010:18:40:16 +1000] "GET / HTTP/1.1" 304 - "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100723 
Ubuntu/10.04 (lucid) Firefox/3.6.8"
192.168.0.101 - - [24/Sep/2010:18:40:20 +1000] "GET /cacti/ HTTP/1.1" 304 - "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) 
Gecko/20100723 Ubuntu/10.04 (lucid) Firefox/3.6.8"
[root@server-01 /var/log]# 

[root@server-01 /var/log]# tail messages
Sep 24 19:29:47 server-01 smbd[1085]: [2010/09/24 19:29:47, 0] printing/print_cups.c:cups_connect(69)
Sep 24 19:29:47 server-01 smbd[1085]:   Unable to connect to CUPS server localhost:631 - Connection refused
Sep 24 19:29:47 server-01 smbd[1085]: [2010/09/24 19:29:47, 0] printing/print_cups.c:cups_connect(69)
Sep 24 19:29:47 server-01 smbd[1085]:   Unable to connect to CUPS server localhost:631 - Connection refused
Sep 24 19:30:02 server-01 pid 82440 (php), uid 107: exited on signal 11
Sep 24 19:30:07 server-01 syslog-ng[572]: STATS: dropped 0
Sep 24 19:30:14 server-01 smbd[78399]: [2010/09/24 19:30:14, 0] printing/print_cups.c:cups_connect(69)
Sep 24 19:30:14 server-01 smbd[78399]:   Unable to connect to CUPS server localhost:631 - Connection refused
Sep 24 19:30:14 server-01 smbd[78399]: [2010/09/24 19:30:14, 0] printing/print_cups.c:cups_connect(69)
Sep 24 19:30:14 server-01 smbd[78399]:   Unable to connect to CUPS server localhost:631 - Connection refused
[root@server-01 /var/log]#
```


----------



## Dereckson (Sep 24, 2010)

If you don't find any solution, you can recompile all the ports:

`# portupgrade -af`
or
`# portmaster -af`


----------



## churchi (Sep 24, 2010)

Thanks Dereckson,

So do you think when i performed the following upgrade command this afternoon (portsnap fetch update && portupgrade -apPDR --batch)
That it could have killed a few ports?

i have the time to recompile the ports, however i am just wondering if that will help.

which command above would you recommend i run?

thanks.


----------



## Dereckson (Sep 24, 2010)

The command to pick is a matter of choice, portupgrade and portmaster being the two more popular ports management tool written respectively in ruby and shell script. The two will rebuild all the the ports.

A core dump error is often a problem of shared library, such an executable A calling a not existent entry point from the lib B.

You updated your ports using packages (your -p flag). Packages are binaries, ie already compiled ports. They could have been compiled against a different version of the libraries than those you have installed.

To recompile all (and before suggesting that I checked you weren't in a graphical environment, so indeed it won't be very long) will ensure a binary compatibility between all the software.


----------



## churchi (Sep 24, 2010)

Thanks for your reply. so you suggest me running: 

```
# portupgrade -af
```
or

```
# portmaster -af
```

These will re-compile my system from scratch?

Thanks.


----------



## Nadja (Sep 24, 2010)

Yes, they will recompile your whole system. Since you seem to have mixed a binary with a non-binary upgrade, this is the preferred way to solve your issues.


----------



## churchi (Sep 24, 2010)

thanks nadja, i will go ahead and kick it off now.

what is the best way to keep my system up to date on a regular basis? should i be compliling form source all the time or from binary is ok?

This command: `portsnap fetch update && portupgrade -apPDR --batch`
is that installing by source or from a pre-compiled binary?

Thanks.


----------



## churchi (Sep 24, 2010)

Hi all,

well i have re compiled my whole system with the command portupgrade -af

Still not working for me with php.

I am getting this error in the /var/log/messages

```
Sep 24 23:54:25 server-01 pid 1384 (httpd), uid 0: exited on signal 11 (core dumped)
```
Any other ideas to what could be causing this issue?

thanks.


----------



## churchi (Sep 24, 2010)

Hi all,

an update. I have upgraded from 8.0 to 8.1 just now. No differance.


```
[root@server-01 /home/churchi]# php
Segmentation fault: 11 (core dumped)
[root@server-01 /home/churchi]#
```

Still getting this bloody core dump error.

not sure what else to do.



```
[root@server-01 /home/churchi]# portsnap fetch update && portmaster -a 
Looking up portsnap.FreeBSD.org mirrors... 5 mirrors found.
Fetching snapshot tag from portsnap6.FreeBSD.org... done.
Latest snapshot on server matches what we already have.
No updates needed.
Ports tree is already up to date.
===>>> Gathering distinfo list for installed ports

===>>> Starting check of installed ports for available updates
===>>> All ports are up to date
[root@server-01 /home/churchi]#
```


----------



## r_t_f_m (Sep 24, 2010)

Check it out here http://www.pingle.org/2007/09/22/php-crashes-extensions-workaround 

You don't have to upgrade everthing (again) just run the fixphpextorder.sh 

Hope it helps


----------



## DutchDaemon (Sep 24, 2010)

churchi, start formatting your posts! I have better things to do.


----------



## churchi (Sep 25, 2010)

r_t_f_m said:
			
		

> Check it out here http://www.pingle.org/2007/09/22/php-crashes-extensions-workaround
> 
> You don't have to upgrade everything (again) just run the fixphpextorder.sh
> 
> Hope it helps



r_t_f_m, thank you very much. The above script works and fixed up all my issues. i wonder why reordering the extensions php now works. must be really touchy.
anyways things are back to normal now. thank you very much.

DutchDaemon, my apologies mate. i will remember to format all posts before posting next time. thanks for fixing them up.



Thank you to everyone who helped get me back on track. much appreciated.


----------

