I have just recently upgraded PHP 5.3 to 5.4 on my Debian Squeeze server. Now, instead of executing PHP files, Apache just downloads them, which is really bad.

When I try to follow these steps, I get "broken packages" upon installing the libapache2-mod-php5 package.

Also the answer tells me to add something to my httpd.conf, but it's empty.

Question: How can I make apache execute php files again, instead of just passing them through as download?

dpkg -l | grep php returns this

rc  libapache2-mod-php5                 5.3.3-7+squeeze15            server-side, HTML-embedded scripting language (Apache 2 module)
rc  php5-cli                            5.3.3-7+squeeze15            command-line interpreter for the php5 scripting language
ii  php5-common                         5.4.15-1~dotdeb.2            Common files for packages built from the php5 source
rc  php5-gd                             5.3.3-7+squeeze15            GD module for php5
rc  php5-mcrypt                         5.3.3-7+squeeze15            MCrypt module for php5
rc  php5-mysql                          5.3.3-7+squeeze15            MySQL module for php5
rc  php5-suhosin                                 advanced protection module for php5
rc  phpmyadmin                          4:3.3.7-7                    MySQL web administration tool

And apt-get install libapache2-mod-php5 produces this error

The following packages have unmet dependencies:
 libapache2-mod-php5 : Depends: libdb5.1 but it is not installable
                       Depends: libssl1.0.0 (>= 1.0.0) but it is not installable
                       Depends: libxml2 (>= 2.8.0) but 2.7.8.dfsg-2+squeeze7 is to be installed
                       Recommends: php5-cli but it is not going to be installed
E: Broken packages
  • Can you show the output of dpkg -l | grep php just for completeness? apache2.conf is the file you need when httpd.conf is empty. But I'm sure you need libapache2-mod-php5 – so what are the "broken packages" exactly? Can you show the full apt output?
    – slhck
    May 23, 2013 at 14:43
  • Sure. I added it to the question.
    – bytecode77
    May 23, 2013 at 14:54

1 Answer 1


What the message means is that libapache2-mod-php5 is not installed (rc means removed (1st letter, r), but configuration files not removed (2nd letter c)). So in order to make apache execute php files again, you will need to reinstall it.

Your package manager says you have unmet dependencies. Basically, as smart as it is, it couldn't figure a way to do what you asked it to do (probably during an update), so you'll need to figure it yourself. See this question for a detailed procedure. The question is specifically on Ubuntu, but most of it is applicable to Debian as well.

In short, you'll need to figure out why those packages are not installable. Use apt-get install libdb5.1 to figure out why libdb5.1 cannot be installed, then apt-get install libssl1.0.0, and finally apt-get install libxml2. This will in turn point you to some other packages that are missing or with a wrong version. Once you figure out where is the problem, you'll probably need to apt-get install -f that package (-f means force).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.