PHP5 now depends on libapache2-mod-php5 even if lighttpd installed

Bug #423071 reported by Andrew Oakley
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

Binary package hint: php5

Following a recent apt-get update && apt-get dist-upgrade , PHP5 appears to now depend on libapache2-mod-php5 .

Since I use lighttpd, and do not have nor want apache installed, this dependency then attempts to drag in the whole apache server. If I let it do this, I suspect apache would clash horribly with lighttpd.

I have therefore refused the latest updates. I know I could work around this with judicious use of dpkg force options, but I would prefer it if the PHP5 dependency were fixed.

I am using Ubuntu Hardy server 8.04.3.

Example:

root@isis:~# date
Tue Sep 1 22:13:16 BST 2009
root@isis:~# apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  apache2-mpm-prefork apache2.2-common libapache2-mod-php5
The following packages will be upgraded:
  kdelibs-data kdelibs4c2a libc6 libc6-dev libc6-i686 libcurl3 libcurl3-gnutls
  libgnutls13 libvorbis0a libvorbisenc2 libvorbisfile3 libxml2 linux-libc-dev
  php-pear php5 php5-cgi php5-cli php5-common php5-curl php5-dev php5-gd
  php5-mysql php5-sqlite php5-xmlrpc php5-xsl tzdata
26 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 41.0MB of archives.
After this operation, 9503kB of additional disk space will be used.
Do you want to continue [Y/n]? n
Abort.
root@isis:~# deborphan -a
main/utils sysutils
main/net telnet
main/interpreters tcl8.4
main/sound mp3info
main/graphics mplayer-nogui
non-free/doc manpages-posix
main/web php5-imagick
main/misc chkrootkit
main/web php5-sqlite3
main/web php5-gd
main/web php5-suhosin
main/web php5-sqlite
main/web php5-xmlrpc
non-free/utils rar
main/net tinyproxy
main/net portmap
main/net rsync
main/web php5-curl
main/web lighttpd
main/utils db4.6-util
main/web vlogger
main/net bind9-host
main/net ntp
main/web php5-memcache
main/misc screen
main/utils debian-helper-scripts
main/admin pwgen
main/admin command-not-found
main/net ldap-utils
main/utils syslinux
main/shells tcsh
main/doc info
main/net iputils-ping
main/net iputils-tracepath
main/admin dselect
main/utils rdiff-backup
main/web php5-xsl
main/graphics imagemagick
main/editors nano
main/utils daemon
main/net ntpdate
main/web php5
main/misc libpam-foreground
main/net fail2ban
main/text patchutils
main/sound lame
main/mail msmtp
main/utils strace
main/misc mysql-server
main/web php5-mysql
main/admin deborphan
main/admin quotatool
main/net netcat
main/utils lsof
main/admin rkhunter

Revision history for this message
Chuck Short (zulcss) wrote :

Thanks for the bug report.

Regards
chuck

Changed in php5 (Ubuntu):
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Andrew Oakley (andrew-aoakley) wrote :

No problem, thanks for your attention.

Just to clarify: This is a *change* in behaviour. Previously, PHP5 did not depend on Apache. Now it does, and it potentially breaks servers which use lighttpd instead of apache.

I already had PHP5 & lighttpd installed, there were previously no dependency issues. A simple apt-get update && apt-get dist-upgrade , if I had have confirmed it, would have BROKEN my system.

Surely that's not wishlist territory? I thought wishlist was for "stuff that it was never supposed to do, but would be nice". Whereas this is something that used to work, but now doesn't.

Revision history for this message
Ondřej Surý (ondrej) wrote :

Andrew,

could you do:

apt-cache policy php5
and
apt-cache show php5

Because php5 depends on libapache2-mod-php5 or php5-cgi

And what does apt say if you do:

apt-get install php5-cgi php5

?

Ondrej

Revision history for this message
Andrew Oakley (andrew-aoakley) wrote :
Download full text (4.0 KiB)

I have removed php5 metapackage and this allowed me to complete apt-get dist-upgrade without installing apache and retaining the other php5- packages.

Ondrej - bearing in mind I removed php5:

root@isis:~# date
Wed Sep 2 15:57:43 BST 2009
root@isis:~# apt-cache policy php5
php5:
  Installed: (none)
  Candidate: 5.2.4-2ubuntu5.7
  Version table:
     5.2.4-2ubuntu5.7 0
        500 http://archive.ubuntu.com hardy-updates/main Packages
        500 http://security.ubuntu.com hardy-security/main Packages
     5.2.4-2ubuntu5 0
        500 http://archive.ubuntu.com hardy/main Packages
root@isis:~# apt-cache show php5
Package: php5
Priority: optional
Section: web
Installed-Size: 20
Maintainer: Ubuntu Core Developers <email address hidden>
Original-Maintainer: Debian PHP Maintainers <email address hidden>
Architecture: all
Version: 5.2.4-2ubuntu5.7
Depends: libapache2-mod-php5 (>= 5.2.4-2ubuntu5.7) | php5-cgi (>= 5.2.4-2ubuntu5.7), php5-common (>= 5.2.4-2ubuntu5.7)
Filename: pool/main/p/php5/php5_5.2.4-2ubuntu5.7_all.deb
Size: 1086
MD5sum: bdd4fc7dcfb03fb949c64cb32b42d991
SHA1: f7b568f049eff614b1dc0e79cbaceecb222eae08
SHA256: f9e80364ed293cb9578d5d120db25d369cfb8551762e803920e67822f93bc880
Description: server-side, HTML-embedded scripting language (meta-package)
 This package is a meta-package that, when installed, guarantees that you
 have at least one of the four server-side versions of the PHP5 interpreter
 installed. Removing this package won't remove PHP5 from your system, however
 it may remove other packages that depend on this one.
 .
 PHP5 is an HTML-embedded scripting language. Much of its syntax is borrowed
 from C, Java and Perl with a couple of unique PHP-specific features thrown
 in. The goal of the language is to allow web developers to write dynamically
 generated pages quickly.
 .
 Homepage: http://www.php.net/
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu

Package: php5
Priority: optional
Section: web
Installed-Size: 20
Maintainer: Ubuntu Core Developers <email address hidden>
Original-Maintainer: Debian PHP Maintainers <email address hidden>
Architecture: all
Version: 5.2.4-2ubuntu5
Depends: libapache2-mod-php5 (>= 5.2.4-2ubuntu5) | php5-cgi (>= 5.2.4-2ubuntu5), php5-common (>= 5.2.4-2ubuntu5)
Filename: pool/main/p/php5/php5_5.2.4-2ubuntu5_all.deb
Size: 1076
MD5sum: 6a1c4f5bbc2a2a50f82edb87f1bc8755
SHA1: 25487a0ceea24b2aa6c0aa61a05c64d0c1d416be
SHA256: f90dca1b16592e4d884803be2bf5ad23b69aaf951c07f12d1a32983a26637fd7
Description: server-side, HTML-embedded scripting language (meta-package)
 This package is a meta-package that, when installed, guarantees that you
 have at least one of the four server-side versions of the PHP5 interpreter
 installed. Removing this package won't remove PHP5 from your system, however
 it may remove other packages that depend on this one.
 .
 PHP5 is an HTML-embedded scripting language. Much of its syntax is borrowed
 from C, Java and Perl with a couple of unique PHP-specific features thrown
 in. The goal of the language is to allow web developers to write dynamically
 generated pages quickly.
 .
 Homepage: http://ww...

Read more...

Revision history for this message
Ondřej Surý (ondrej) wrote :

I've seen this before. I more looks like apt bug and not php5s.

Revision history for this message
Andrew Oakley (andrew-aoakley) wrote :

Yeah, unless PHP5 has been re-released between the start of this bug report and now, it does indeed look like apt was not correctly interpreting the "or" | pipe operator in:

Depends: libapache2-mod-php5 (>= 5.2.4-2ubuntu5) | php5-cgi (>= 5.2.4-2ubuntu5), php5-common (>= 5.2.4-2ubuntu5)

I already had php5-cgi installed, so this should have satisfied the dependency. Interestingly, apt-get dist-upgrade wanted to upgrade php5-cgi at the same time as php5, so I'm wondering whether this is due to some failing in the ordering of dependencies during dist-upgrade? I.e. since php5-cgi was due to be upgraded, it ignored the fact that it was already installed when it came to calculate dependencies for the php5 metapackage.

Looking through the depends for php5-cgi and php5-common, there don't seem to be any other places where apache dependencies creep in. So it must have been the php5 metapackage which was causing apt to want apache.

I'm now uncertain as to whether this is a bug in apt-get or a bug in php5. Perhaps leave this bug report lying around for a couple of weeks, and if nobody else gets the same problem, shift it to apt-get ?

Revision history for this message
FrancisT (francis-turner) wrote :

I did a clean install of ununtu 9.10 and hit this - to my surprise - when rebuilding me preferred server config. Unfortunately I did not notice that apache2 was being installed until it had already shown up. Uninstalling apache and then installing php5-cgi seems to have fixed this (once i restarted lighttpd).

The inclusion of apache should probably be documented more clearly with the alternative mentioned in the package description

Revision history for this message
Ondřej Surý (ondrej) wrote :

I don't think there's a bug in PHP5 here, if the apache2 is getting installed then it's a bug in APT resolving the dependencies somewhere.

Also it _is_ documented:
 This package is a meta-package that, when installed, guarantees that you
 have at least one of the four server-side versions of the PHP5 interpreter
 installed. Removing this package won't remove PHP5 from your system, however
 it may remove other packages that depend on this one.

And there's no bug in 9.10 - this is normal behaviour. If you run "apt-get install php5" it will install the first alternative dependency. If you did "apt-get install php5 php5-cgi" then it would work.

Revision history for this message
Ondřej Surý (ondrej) wrote :

No problem in php5, seems like apt is chosing wrong packages.

affects: php5 (Ubuntu) → apt (Ubuntu)
Revision history for this message
Charles Dumont (unomadh) wrote :

The problem is not only between php5 and apache :

mediawiki depends on mysql (What if you prefer pgsql ?)
mediawiki depends on php5 -> depends on apache (What if you prefer Lighttpd ?)

It seems like mysql and apache are taken as if there would be no alternative (and as if there couldn't be any). Please fix

Thanks

Revision history for this message
Julian Andres Klode (juliank) wrote :

I'm marking this as fix released, as the bug is probably fixed in recent APT versions. If this is still reproducible in wily, please reopen.

Changed in apt (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.