Cannot compile any version of PHP I want on Lucid due to dependencies in apache2-prefork-dev
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
php5 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Background:
Like MANY server admins who use PHP and run some old code, I have two requirements that are not what the Ubuntu package team has deemed as they way they want to support out of the box:
- PHP 5.2.X branch on a Lucid server
- Compiled with PHP's original bundled GD library, so that I don't lose a pile of functions I need
The solution would normally be to compile your own version, right? Wrong, can't do it, because a few critical *-dev packages have stupid dependencies!
Compiling your own php5 to get around the insufficient decision the Ubuntu team made to replace PHP's bundled GD library with their own fails, unless you are compiling the version of PHP that came with your release of Ubuntu. Compiling your own replacement php5 package depends on apache2-prefork-dev depends on apache2.2-common and libaprutil1-dev, libaprutil1-dev in turn depends on libaprutil1, and libaprutil1 in turn depends on libdb4.7-dev, and libdb4.7-dev in turn depends on libdb4.7.
There is no good reason a -dev package should depend on it's non-dev equivalent. The reason I say this is that it means that one who needed and thus installed the 5.2.X branch of PHP on their system that normally comes with the 5.3.X branch, cannot possibly recompile a 5.2.X branch of PHP on their server.
My possible solutions appear to be as follows:
- Set up a Karmic server (comes with PHP 5.2.10) just to compile the .deb file I want, then install it on my production server
- Try to force installing the packages with the stupid dependencies and risk breaking my system just so I can compile a replacement package on the same server I am going to use it on (apt-get wont do this, and dpkg requires me to obtain the .deb files first, so after some browsing finally I can try with "dpkg --force-depends -i", so that is yet another annoyance!)
- Try to convince the Ubuntu package team to release packages for the PHP 5.2.X branch on Lucid, since the PHP group still actively supported this branch, and many sysadmins still actively depend on it, yet also want or need an up-to-date server.
Actual Problem:
Compiling your own php5 to get around the insufficient decision the Ubuntu team made to replace PHP's bundled GD library with their own fails, unless you are compiling the version of PHP that came with your release of Ubuntu.
I found out that the Ubuntu package team decided to replace PHP's GD library with the Ubuntu system library, yet alot of functions are missing from this version. I heard people discuss that another option would be if someone would compile an alternative version of GD we could have an alternative version of PHP that used this alternative version of GD. Apparently this never happened. I need a fully functioning installation of PHP 5.2.X, so apparently as the Ubuntu team has not provided it I have to provide it for myself, but again, this fails. Really, I only needed a version of the package php5_gd that uses PHP's bundled GD library instead of the system library, but that requires compiling all of PHP, which again, fails.
Steps to Reproduce Issue:
- Install Ubuntu LTS 10.04 (Lucid) fresh
- Apply all updates
- change /etc/apt/
- Install PHP 5.2.10 from Karmic
- Change /etc/apt/
- Realize that the Ubuntu package team did not bundle PHP's GD library when they compiled the php5 package, and that the only solution if you want a properly working PHP with all GD functions is to compile a replacement
- Compile fails due to retarded dependencies in libaprutil1-dev and apache2-prefork-dev and such
- Try to force installing a bunch of packages despite the stupid dependencies, hoping that they don't really need those dependencies anyway, potentially wrecking your live production webserver, just so you can have a chance at running a complete proper PHP package of the version that you need on the version of Ubuntu that you need
affects: | ubuntu → php5 (Ubuntu) |
I managed to compile PHP finally, and all it took was several hours and countless steps. It's so simple your kids can do it!
Process (roughly, your mileage may vary, and i may have forgotten a step):
cd /tmp sources. list openssl- dev libedit-dev libfreetype6-dev libgcrypt11-dev libgd2-xpm-dev libgmp3-dev libjpeg62-dev libmhash-dev libncurses5-dev libpam0g-dev libpng12-dev libpspell-dev librecode-dev libsasl2-dev libsnmp-dev libsqlite0-dev libt1-dev libtidy-dev libwrap0-dev libxmltok1-dev libxml2-dev libxslt1-dev quilt re2c unixodbc-dev launchpadlibrar ian.net/ 59612230/ libaprutil1- dev_1.3. 9%2Bdfsg- 1ubuntu1. 1_amd64. deb dev_1.3. 9+dfsg- 1ubuntu1. 1_amd64. deb launchpadlibrar ian.net/ 59612303/ apache2- prefork- dev_2.2. 12-1ubuntu2. 4_amd64. deb prefork- dev_2.2. 12-1ubuntu2. 4_amd64. deb openssl- de...
apt-get source php5
apt-get install build-essential debhelper fakeroot
vi /etc/apt/
apt-get source php5
gunzip *.gz
ls
cd php5-5.2.10.dfsg.1/
vi debian/rules
#(remove ",/usr" where it talks about the GD library so it uses its bundled library instead of the system library, as is desired)
dpkg-buildpackage -rfakeroot
#(fails due to dependencies, start installing them)
apt-get install libaprutil1-dev
#(should fail due to existing version of libaprutil1 and libdb4.7, which you DONT want to remove
apt-get install bison chrpath flex freetds-dev libbz2-dev libcurl4-
wget http://
apt-get install libsqlite3-dev libpq-dev libmysqlclient-dev uuid-dev libpcrecpp0 libpcre3-dev
dpkg --force-depends -i libaprutil1-
wget http://
dpkg --force-depends -i apache2-
cd php5-5.2.10.dfsg.1/
dpkg-buildpackage -rfakeroot
#FINALLY COMPILED, PROCEED TO REMOVE ALL CRAP AND RESTORE SYSTEM TO PREVIOUS STATE
aptitude
#(USED APTITUDE TO FIX CONFLICTS)
#(NOW REMOVE ALL THOSE SHIT PACKAGES YOU HAD TO INSTALL TO COMPILE)
apt-get remove libpng12-dev libpq-dev libpspell-dev librecode-dev libsasl2-dev libsnmp-dev libsqlite0-dev libt1-dev libtidy-dev libwrap0-dev libxmltok1-dev libxml2-dev libxslt1-dev
apt-get remove libmysqlclient-dev libncurses5-dev libpam0g-dev libpcre3-dev
apt-get install lm-sensors
apt-get autoremove
apt-get install lm-sensors
apt-get remove libfreetype6-dev libgcrypt11-dev libgd2-xpm-dev libgmp3-dev libjpeg62-dev libkrb5-dev libldap2-dev libmhash-dev
apt-get autoremove
apt-get remove comerr-dev krb5-multidev libapr1-dev libaprutil1-dev libdb4.8-dev libexpat1-dev libgssrpc4 libkadm5clnt-mit7 libkadm5srv-mit7 libkdb5-4 libkrb5-dev
apt-get remove comerr-dev krb5-multidev libapr1-dev libdb4.8-dev libexpat1-dev libgssrpc4 libkadm5clnt-mit7 libkadm5srv-mit7 libkdb5-4 libkrb5-dev libldap2-dev
apt-get remove libmysqlclient-dev libpcre3-dev libpcrecpp0 libpq-dev libsqlite3-dev uuid-dev
apt-get remove libldap2-dev libmysqlclient-dev libpcre3-dev libpcrecpp0 libpq-dev libsqlite3-dev uuid-dev
apt-get remove libxml2-dev libxslt1-dev
apt-get remove libgd2-xpm-dev libgmp3-dev libjpeg62-dev libkrb5-dev libldap2-dev libmhash-dev (>= 0.8.8) libmysqlclient-dev libncurses5-dev libpam0g-dev
apt-get remove libgd2-xpm-dev libgmp3-dev libjpeg62-dev libkrb5-dev libldap2-dev libmhash-dev libmysqlclient-dev libncurses5-dev libpam0g-dev
apt-get remove install bison chrpath flex freetds-dev libbz2-dev libcurl4-