1

I have a legacy app which requires a specific version of php. I've downloaded debs for php, pear, etc. from old-releases.ubuntu.com, and I am writing a script to install them when provisioning a server.

The problem is that libapache2-mod-php5_5.4.9-4ubuntu2_amd64.deb depends on apache2.2-common:

Preparing to unpack .../libapache2-mod-php5_5.4.9-4ubuntu2_amd64.deb ...
Unpacking libapache2-mod-php5 (5.4.9-4ubuntu2) over (5.4.9-4ubuntu2) ...
dpkg: dependency problems prevent configuration of libapache2-mod-php5:
 libapache2-mod-php5 depends on apache2.2-common; however:
  Package apache2.2-common is not installed.

dpkg: error processing package libapache2-mod-php5 (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libapache2-mod-php5

There is no apache2.2-common available in the newer apache2 packages:

$sudo apt-get install apache2.2-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package apache2.2-common is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  apache2-data apache2-bin apache2

E: Package 'apache2.2-common' has no installation candidate

I don't want to dpkg --force-all on this install since that may cause problems with other package installs. I tried to build a fake package which would provide apache2.2-common to satisfy the old version of php as described in How can I install a package without installing some dependencies?, but my fake package conflicts with apache2. I think this is because apache2 lists apache2.2-common as a conflicting package.

Is there a "correct" way to do this? I'd like to keep as much of my stack current as possible, since it's harder to maintain old versions and it's a security liability. I'd prefer to prevent package manager problems too, if possible. If this particular php package is the only thing I --force-all on, and few things depend on it, maybe it won't screw up the system too badly. I'm guessing there is no good way to do this, but I'd settle for the least broken method.

[Edit] I have installed apache2-mpm-prefork as mentioned in Why do apache2 upgrades remove and not re-install libapache2-mod-php5?. [/Edit]

[Edit 2] I installed this using --force-all, and it isn't working correctly. I get the following error when I try to start apache:

$ sudo service apache2 restart
 * Restarting web server apache2                                         [fail] 
 * The apache2 configtest failed.
Output of config test was:
apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/php5.load: Cannot load /usr/lib/apache2/modules/libphp5.so into server: /usr/lib/apache2/modules/libphp5.so: undefined symbol: unixd_config
Action 'configtest' failed.
The Apache error log may have more information.

The Apache error log did not have any information about this. [/Edit 2]

0

You must log in to answer this question.

Browse other questions tagged .