# [solved] upgrade of php5 causes trouble to start apache

## PoYpOy

Hi,

I've just ran an update of php 5.2 to 5.3.6 and my apache now doesn't start anymore with the flag -D PHP5 in /etc/conf.d/apache2

I've deleted all the folders of apache, same for php but still not starting. With flag -D PHP, it does start well... 

the file referenced into /etc/apache2/modules.d/70_mod_php5.conf does exist and I've ran an revdep-rebuild and nothing has been emerged.

Any ideas of what could be the problem?

PoyLast edited by PoYpOy on Wed Aug 10, 2011 10:13 am; edited 1 time in total

----------

## tomk

Did you follow the upgrade guide?

----------

## PoYpOy

Hello and thanks for your reply,

yes I do. the only wierd thing is that at this point :

Code Listing 4.2: list PHP config directories

$ ls -1 /etc/php

apache2-php5

cli-php5

cgi-php5

on my gentoo I have :

# ls -1 /etc/php

apache2-php5

apache2-php5.3

cgi-php5.3

cli-php5

cli-php5.3

could this be the problem?

----------

## tomk

That's OK the config for 5.3 now lives in the /etc/php/apache2-php5.3/ directory.

Can you post the output of:

```
emerge --info =dev-lang/php-5.3.6
```

----------

## PoYpOy

sure, here you go :

```
Portage 2.1.10.3 (default/linux/x86/10.0/server, gcc-4.3.4, glibc-2.12.2-r0, 2.6                                                             .31-gentoo-r10 i686)

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

                        System Settings

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

System uname: Linux-2.6.31-gentoo-r10-i686-Intel-R-_Core-TM-2_CPU_6300_@_1.86GHz                                                             -with-gentoo-2.0.2

Timestamp of tree: Mon, 18 Jul 2011 13:45:01 +0000

app-shells/bash:          4.1_p9

dev-lang/python:          2.6.4-r1, 2.7.1-r1, 3.1.3-r1

dev-util/cmake:           2.8.4-r1

dev-util/pkgconfig:       0.26

sys-apps/baselayout:      2.0.2

sys-apps/openrc:          0.8.3-r1

sys-apps/sandbox:         2.4

sys-devel/autoconf:       2.68

sys-devel/automake:       1.9.6-r2, 1.10.3, 1.11.1

sys-devel/binutils:       2.20.1-r1

sys-devel/gcc:            4.3.4, 4.4.5

sys-devel/gcc-config:     1.4.1-r1

sys-devel/libtool:        2.2.10

sys-devel/make:           3.82

sys-kernel/linux-headers: 2.6.36.1 (virtual/os-headers)

sys-libs/glibc:           2.12.2

Repositories: gentoo

ACCEPT_KEYWORDS="x86"

ACCEPT_LICENSE="* -@EULA"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-O2 -march=i686 -pipe"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf                                                              /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-                                                             php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sand                                                             box.d /etc/terminfo"

CXXFLAGS="-O2 -march=i686 -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles fixpackag                                                             es news parallel-fetch protect-owned sandbox sfperms strict unknown-features-war                                                             n unmerge-logs unmerge-orphans userfetch"

FFLAGS=""

GENTOO_MIRRORS="http://mirror.switch.ch/ftp/mirror/gentoo/ http://mirrors.linuxa                                                             nt.fr/distfiles.gentoo.org/ "

LDFLAGS="-Wl,-O1 -Wl,--as-needed"

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress                                                              --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclu                                                             de=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY=""

SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"

USE="acl ads apache2 berkdb bzip2 cgi cli cracklib crypt ctype cxx dri filter fo                                                             rtran gd gdbm gpm iconv ipv6 jpeg kerberos ldap lm_sensors logrotate modules mud                                                             flap mysql ncurses nls nptl nptlonly openmp pam pcre perl php png pppd python re                                                             adline samba session snmp sockets spl ssl sysfs tcpd truetype unicode winbind x8                                                             6 xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cm                                                             ipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 int                                                             el8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS                                                             ="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug                                                              ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm                                                              softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn                                                             _dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile                                                              authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock d                                                             bd deflate dir disk_cache env expires ext_filter file_cache filter headers ident                                                              imagemap include info log_config logio mem_cache mime mime_magic negotiation pr                                                             oxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so spelin                                                             g status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="braindump f                                                             low karbon kexi kpresenter krita tables words" CAMERAS="ptp2" COLLECTD_PLUGINS="                                                             df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="                                                             ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nm                                                             ea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2                                                              timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux                                                             " LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses                                                              text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbd                                                             ev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx triden                                                             t vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv                                                             4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat l                                                             ogmark ipmark dhcpmac delude chaos account"

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LING                                                             UAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_                                                             RSYNC_EXTRA_OPTS

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

                        Package Settings

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

dev-lang/php-5.3.6 was built with the following:

USE="apache2 berkdb bzip2 cgi cli crypt ctype fileinfo filter gd gdbm hash iconv                                                              ipv6 json kerberos ldap mysql nls posix readline session simplexml snmp sockets                                                              ssl tokenizer truetype unicode xml zlib -adabas -bcmath -birdstep -calendar -cd                                                             b -cjk -curl -curlwrappers -db2 -dbmaker -debug -doc -embed -empress -empress-bc                                                             s -enchant -esoob -exif -firebird -flatfile -fpm -frontbase -ftp -gd-external -g                                                             mp -imap -inifile -interbase -intl -iodbc -kolab -ldap-sasl -libedit -mhash -mss                                                             ql -mysqli -mysqlnd -oci8 -oci8-instant-client -odbc -pcntl -pdo -phar -pic -pos                                                             tgres -qdbm -recode -sapdb -sharedext -sharedmem -soap -solid -spell -sqlite -sq                                                             lite3 -sybase-ct -sysvipc -threads -tidy -wddx -xmlreader -xmlrpc -xmlwriter -xp                                                             m -xsl -zip"

```

----------

## tomk

That all looks OK. Do you get any errors when you start apache, either on the command line or in the /var/log/apache2/error_log file?

----------

## PoYpOy

this is the only thing I get when I try to start it:

```
/etc/init.d/apache2 restart

 * Caching service dependencies ...                                                                                                    [ ok ]

 * Stopping apache2 ...                                                                                                                [ ok ]

 * Starting apache2 ...                                                                                                                [ !! ]

 * ERROR: apache2 failed to start
```

the file /var/log/apache2/error_log is empty.

If I keep -D PHP, apache2 starts well but the php file hosted doesn't show properly. if I put -D php5 it crashes as show bellow.

----------

## PoYpOy

Hello

any news regarding my issue?

I've got this on the error_log of apache fyi

```
[Wed Aug 03 09:33:33 2011] [notice] caught SIGTERM, shutting down

[Wed Aug 03 10:34:10 2011] [notice] Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/1.0.0d configured -- resuming normal operations

[Wed Aug 03 12:06:14 2011] [notice] caught SIGTERM, shutting down

[Wed Aug 03 12:07:02 2011] [notice] Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/1.0.0d configured -- resuming normal operations

[Wed Aug 03 12:28:08 2011] [notice] caught SIGTERM, shutting down

[Wed Aug 03 12:28:59 2011] [notice] Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/1.0.0d configured -- resuming normal operations

```

any ideas?

----------

## Raptor85

please post the contents of 70_mod_php5.conf here

----------

## PoYpOy

sure here you go :

```
<IfDefine PHP5>

        # Load the module first

        <IfModule !mod_php5.c>

                LoadModule php5_module    modules/libphp5.so

        </IfModule>

        # Set it to handle the files

        <IfModule mod_mime.c>

                AddHandler application/x-httpd-php .php .php5 .phtml

                AddHandler application/x-httpd-php-source .phps

        </IfModule>

        DirectoryIndex index.php index.phtml

</IfDefine>
```

and this what I ve found in /var/log/messages 

```
Aug  8 18:17:14 GCHPPX01 kernel: [455267.071398] apache2[1904]: segfault at 10 ip b72027ca sp bfbe14e0 error 4 in libcrypto.so.1.0.0[b7140000+14e000]

Aug  8 18:17:23 GCHPPX01 /etc/init.d/apache2[1734]: ERROR: apache2 failed to start

```

----------

## tomk

Sorry should have said to look for segfaults in /var/log/messages. That looks like this issue, does running the revdep-rebuild command stated there help?

----------

## PoYpOy

Hi Tomk

it's exactly what I was looking for. That thing 

# revdep-rebuild --library libssl.so.0.9.8

# revdep-rebuild --library libcrypto.so.0.9.8 

with a emerge -av dev-python/setuptools solved the problem =)

Many thanks for your help

Regards

Poy

----------

