After I upgraded yesterday from dev-lang/php-5.3.3-r1 to dev-lang/php-5.3.4 I got now : n22 /etc/apache2/modules.d # /etc/init.d/apache2 stop * Stopping apache2 ... apache2: Syntax error on line 175 of /etc/apache2/httpd.conf: Syntax error on line 4 of /etc/apache2/modules.d/70_mod_php5.conf: Cannot load /usr/lib/apache2/modules/libphp5.so into server: /usr/lib/apache2/modules/libphp5.so: cannot open shared object file: No such file or directory FWIW I've this : $> cat /etc/portage/bashrc post_src_install() { lafilefixer "${D}" } Reproducible: Always
n22 /etc/apache2/modules.d # emerge --info dev-lang/php Portage 2.1.9.24 (default/linux/x86/10.0/desktop/kde, gcc-4.4.4, glibc-2.11.2-r3, 2.6.36.2 i686) ================================================================= System Settings ================================================================= System uname: Linux-2.6.36.2-i686-Intel-R-_Core-TM-2_Duo_CPU_P8600_@_2.40GHz-with-gentoo-1.12.14 Timestamp of tree: Mon, 20 Dec 2010 08:45:02 +0000 ccache version 2.4 [enabled] app-shells/bash: 4.1_p7 dev-java/java-config: 2.1.11-r1 dev-lang/python: 2.6.6-r1, 3.1.2-r4 dev-util/ccache: 2.4-r9 dev-util/cmake: 2.8.1-r2 sys-apps/baselayout: 1.12.14-r1 sys-apps/sandbox: 2.4 sys-devel/autoconf: 2.13, 2.65-r1 sys-devel/automake: 1.9.6-r3, 1.10.3, 1.11.1 sys-devel/binutils: 2.20.1-r1 sys-devel/gcc: 4.4.4-r2 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.2.10 sys-devel/make: 3.81-r2 virtual/os-headers: 2.6.30-r1 (sys-kernel/linux-headers) ACCEPT_KEYWORDS="x86" ACCEPT_LICENSE="*" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=native -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/config" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /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/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-O2 -march=native -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="assume-digests binpkg-logs ccache compress-build-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch" GENTOO_MIRRORS="http://gentoo.mirror.dkm.cz/pub/gentoo/ http://gentoo.wheel.sk/ http://91.121.125.139/gentoo-distfiles/ http://91.121.124.139/gentoo-distfiles/" LANG="en_US.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="en en_GB" 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 --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://linux.rz.ruhr-uni-bochum.de/gentoo-portage" USE="X a52 aac acl acpi alsa apache2 berkdb bluetooth branding bzip2 cairo cdda cddb cdio cdr clamav cli consolekit cracklib crypt css cups cxx dbus dri dts dvb dvd dvdr emboss encode exif fam fastbuild fat ffmpeg firefox flac fortran gdbm gdu geoip gif git gmp gphoto2 gpm gtk hyphenation iconv ieee1394 ipv6 java jpeg kde kqemu lastfm lcms ldap libnotify lirc logrotate mad mbox mikmod mmx mng modules mp3 mp4 mpeg mudflap mysql nano-syntax ncurses nls nptl nptlonly nsplugin ntfs ogg opengl openmp pam pango pcre pdf perl png policykit ppds pppd python qt3support qt4 rdesktop readline rss samba sdl session spell sse sse2 sse3 ssl ssse3 startup-notification svg sysfs tcpd thinkpad tiff tk truetype udev unicode usb vcd vim-syntax vorbis wmf x264 x86 xcb xcomposite xine xml xorg xpm xscreensaver xulrunner xv xvid zlib" ALSA_CARDS="hda-intel" 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 dav dav_fs dav_lock dbd 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 proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard evdev mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_GB" LIRC_DEVICES="devinput inputlirc" PHP_TARGETS="php5-2" QEMU_SOFTMMU_TARGETS="i386" QEMU_USER_TARGETS="i386" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS ================================================================= Package Settings ================================================================= dev-lang/php-5.3.4 was built with the following: USE="apache2 berkdb bzip2 cli crypt ctype exif fileinfo filter gd gdbm gmp hash iconv ipv6 json ldap mysql nls phar posix readline session simplexml spell ssl tokenizer truetype unicode xml xpm zlib -adabas -bcmath -birdstep -calendar -cdb -cgi -cjk -curl -curlwrappers -db2 -dbmaker -debug -doc -embed -empress -empress-bcs -enchant -esoob -firebird -flatfile -fpm -frontbase -ftp -gd-external -imap -inifile -interbase -intl -iodbc -kerberos -kolab -ldap-sasl -libedit -mssql -mysqli -mysqlnd -oci8 -oci8-instant-client -odbc -pcntl -pdo -pic -postgres -qdbm -recode -sapdb -sharedext -sharedmem -snmp -soap -sockets -solid -sqlite -sqlite3 -sybase-ct -sysvipc -threads -tidy -wddx -xmlreader -xmlrpc -xmlwriter -xsl -zip"
I'm experiencing the same problem.
FWIW this solves/circumvents the issue : n22 ~ # grep LoadModule /etc/apache2/modules.d/70_mod_php5.conf #LoadModule php5_module modules/libphp5.so LoadModule php5_module /usr/lib/php5.3/apache2/libphp5.so
(In reply to comment #3) > FWIW this solves/circumvents the issue : > n22 ~ # grep LoadModule /etc/apache2/modules.d/70_mod_php5.conf > #LoadModule php5_module modules/libphp5.so > LoadModule php5_module /usr/lib/php5.3/apache2/libphp5.so > Thanks much!
(In reply to comment #3) > FWIW this solves/circumvents the issue : > n22 ~ # grep LoadModule /etc/apache2/modules.d/70_mod_php5.conf > #LoadModule php5_module modules/libphp5.so > LoadModule php5_module /usr/lib/php5.3/apache2/libphp5.so > Weird.. it's also missing PHP binary? Or it's in a different location? My CLI scripts are failing now. /bin/sh: /usr/bin/php: No suck file or directory
(In reply to comment #5) > (In reply to comment #3) > > FWIW this solves/circumvents the issue : > > n22 ~ # grep LoadModule /etc/apache2/modules.d/70_mod_php5.conf > > #LoadModule php5_module modules/libphp5.so > > LoadModule php5_module /usr/lib/php5.3/apache2/libphp5.so > > > > Weird.. it's also missing PHP binary? Or it's in a different location? My CLI > scripts are failing now. > > /bin/sh: /usr/bin/php: No suck file or directory > /usr/bin/php is a symlink to /usr/lib/php5/bin/php ls -al /usr/lib/php5/bin/php ls: cannot access /usr/lib/php5/bin/php: No such file or directory Had to recreate the symlink to here: /usr/lib/php5.3/bin/php annoying.
(In reply to comment #6) > Had to recreate the symlink to here: > /usr/lib/php5.3/bin/php Same with php-cgi when using as fastcgi for lighttpd
(In reply to comment #7) > Same with php-cgi when using as fastcgi for lighttpd Reading http://www.gentoo.org/proj/en/php/php-guide.xml as shown in the post-install-message fixes my problem. Hrrr...
Apache now has an eselect module. Everybody just needs to run whichever of these lines are appropriate for the SAPIs you have installed: eselect php set cli php5.3 eselect php set apache2 php5.3 eselect php set fpm php5.3 eselect php set cgi php5.3 Why doesn't the eselect get run automatically by the ebuild since no valid selection is made like most eselectable ebuilds do? No idea. That is teh annoy. :)
(In reply to comment #9) > Apache now has an eselect module. Everybody just needs to run whichever of > these lines are appropriate for the SAPIs you have installed: > > eselect php set cli php5.3 > eselect php set apache2 php5.3 > eselect php set fpm php5.3 > eselect php set cgi php5.3 > > Why doesn't the eselect get run automatically by the ebuild since no valid > selection is made like most eselectable ebuilds do? No idea. That is teh annoy. > :) > You will still need to copy your php.ini to the appropriate apache/cli directories.. or it will just use the default php.ini. l
It sounds like comment #9 provides a solution; please reopen if I have misinterpreted the commentary here.
Please take a look at comment #3. Without adapting that entry no php script is run at my system, instead the php source code is displayed.
(In reply to comment #12) > Please take a look at comment #3. Without adapting that entry no php script is > run at my system, instead the php source code is displayed. > Forgot this, PEBKAC
Reopening.
I will admit that this php stuff is a bit over my head. I'll let someone else handle this.
A few things: 1. The change in comment #3 should *not* be necessary, and my own installation is proof that it is not. Making that change bypasses the eselect system completely, and guarantees another failure in the future. "modules/libphp5.so" is the *right* location. eselect symlinks that to the PHP lib version you select: $ cd /usr/lib/apache2/ $ ls -l modules/libphp5.so lrwxrwxrwx 1 root root 34 Dec 20 16:21 modules/libphp5.so -> /usr/lib/php5.3/apache2/libphp5.so <--- eselect did this! 2. There still exists a bug, though, so this bug should remain open. The bug is that according to the "Upgrading PHP" guide, the necessary eselect should have been run automatically so as not to break everyone's apache, which is unfortunately what happened. See http://www.gentoo.org/proj/en/php/php-guide.xml#doc_chap4_sect1
(In reply to comment #16) > 1. The change in comment #3 should *not* be necessary Right, it is not a fix of the bug, only a circumvention. The underlying problem (at least for me) was, that a "eselect php list apache2" gave "1] php5.3 *" as an output although the symlink doesn't exists - and I believed the output and didn't made a "eselect ... set" nevertheless. IMHO independent of an "eselect ... list" and "eselect ... set" should be forced by the ebuild, or ?
(In reply to comment #17) > (In reply to comment #16) > > 1. The change in comment #3 should *not* be necessary > Right, it is not a fix of the bug, only a circumvention. > > The underlying problem (at least for me) was, that a "eselect php list > apache2" gave "1] php5.3 *" as an output although the symlink doesn't exists > - and I believed the output and didn't made a "eselect ... set" nevertheless. > IMHO independent of an "eselect ... list" and "eselect ... set" should be > forced by the ebuild, or ? > The ebuild use eselect php to check for the existence of a valid symlink. When upgrading to a new version of php, the old symlink to /usr/bin/php should be broken and eselect should pick this up and recreate a new one with the highest version of php. If this doesn't work for you, I am curious about what eselect php show cli says prior to you fixing the symlink.
*** Bug 349538 has been marked as a duplicate of this bug. ***
(In reply to comment #18) If this doesn't work for you, I am curious about what eselect > php show cli says prior to you fixing the symlink. I got this (therefore I did not run "eselect ... set ..."): n22 ~ # eselect php list apache2 [1] php5.3 *
(In reply to comment #20) > (In reply to comment #18) > If this doesn't work for you, I am curious about what eselect > > php show cli says prior to you fixing the symlink. > > I got this (therefore I did not run "eselect ... set ..."): > > n22 ~ # eselect php list apache2 > [1] php5.3 * > Are you certain there was no symlink there already? The link may have been broken, but it should still be there. If not, I do not see how eselect could claim that the link already exists.
(In reply to comment #21) > The link may have been broken, but it should still be there. That might be the case - of course. I'm unsure whether I checked that or not.
As I cannot reproduce this myself, I need information from those who encountered this problem. On top of my head, I need the output, where applicable, from the following commands: eselect php show <sapi> ls -l /usr/bin/php ls -l /usr/lib/apache2/modules/libphp5.so ls -l /usr/lib64/apache2/modules/libphp5.so
In my case, I got this for each of cli apache2 cgi: # eselect php list ___ [1] php5.3 It fixed itself after doing eselect php set
(In reply to comment #24) > In my case, I got this for each of cli apache2 cgi: > > # eselect php list ___ > [1] php5.3 > > It fixed itself after doing eselect php set > this is clearly incorrect. the lack of the star means something went wrong during the install. I am really curious if there was an existing symlink and what it pointed to
Well I decided to take the plunge on the other server I administer, and... (11:31:53 Mon Dec 27 2010 root@upe i686) /var/db/pkg # eselect php list cli [1] php5.3 (11:32:56 Mon Dec 27 2010 root@upe i686) /var/db/pkg # ls -l /usr/bin/php lrwxrwxrwx 1 root root 21 Mar 2 2008 /usr/bin/php -> /usr/lib/php5/bin/php
Also... /usr/lib/php5/bin/php doesn't exist, so the link is broken. /usr/lib/php5/bin/php was provided by php-5.3.3-r1 and was removed when php-5.3.4 was installed (and 5.3.3-r1 was uninstalled). /usr/bin/php was probably set by php-toolkit-1.0.1 which was obviously removed at the same time. Here are the timestamps from my saved logs, so you can see eselect-php was installed and php-toolkit uninstalled... php-5.3.4 installed and 5.3.3-r1 uninstalled: -rw-rw---- 1 portage portage 484 Dec 22 10:37 app-admin:eselect-php-0.6.1:20101222-183737.log.bz2 -rw-rw---- 1 portage portage 198 Dec 22 10:38 app-admin:php-toolkit-1.0.1:20101222-183759.log.bz2 -rw-rw---- 1 portage portage 39067 Dec 22 11:51 dev-lang:php-5.3.4:20101222-192420.log.bz2 -rw-rw---- 1 portage portage 2161 Dec 22 11:51 dev-lang:php-5.3.3-r1:20101222-195155.log.bz2
eselect php set apache2 php5.3 that did the trick for me , thanks
Finally found the issue and mabi sorted it out nicely. We bumped a new version of eselect-php that should fix the issue.
(In reply to comment #29) > Finally found the issue and mabi sorted it out nicely. We bumped a new version > of eselect-php that should fix the issue. I just had this happen on Apache going from 5.3.3-r1 to 5.3.5. During the merge, I got the message "Switched apache2 to use php:5.3". Given that, I assumed things were kosher, but alas, the symlink wasn't there. eselect-php and php-toolkit were updated before the new PHP. Is this still a bug?
Last 2 day's I searched for resolving same problem. Tryed to recompile Apache and PHP with many times with different settings. Double check all USE flags, tryed many advices from many forums. To get on the right way helped me analize of commnads /etc/init.d/apache2 configdump /etc/init.d/apache2 modules I recognized, that 70_mod_php5.conf was not affected even if it where on the right place with the right content. Finaly in my case helped to add line LoadModule php5_module modules/libphp5.so directly into the /etc/apache2/httpd.conf Mintaka@post.cz
(In reply to comment #30) > (In reply to comment #29) > > Finally found the issue and mabi sorted it out nicely. We bumped a new version > > of eselect-php that should fix the issue. > > I just had this happen on Apache going from 5.3.3-r1 to 5.3.5. During the > merge, I got the message "Switched apache2 to use php:5.3". Given that, I > assumed things were kosher, but alas, the symlink wasn't there. eselect-php > and php-toolkit were updated before the new PHP. > > Is this still a bug? > The problem is as follows: 1. php:5.3 ebuilds run eselect-php to replace libphp5.so with a symlink, following the new minor version slotting scheme 2. php:5 ebuild gets unmerged. It thinks the symlink created by eselect-php still belongs to the php:5 ebuild so the symlink gets deleted. Running eselect php manually fixes the issue. And this will not happen in subsequent updates. Now, we could fix this in the ebuild by renaming libphp5.so to e.g mod_php5.so, but then we also need to ship multiple config files for apache etc. As many people seem to have already migrated to minor version slotting, renaming the .so file could cause more harm done.