I'm trying to downgrade PHP from 5.5 to 5.3 (not by choice).

I thought I uninstalled php 5.5 by typing the following sudo apt-get remove "php*"

I then installed php 5.3 by following these instructions

How ever when I called phpinfo() inside a script and run it, I still get PHP Version 5.5.9-1ubuntu4.19

But when I call php -v from the command line I get PHP 5.3.29 (cli) (built: Sep 2 2016 10:56:16)

When I cd to root directory and type locate libphp5.so there is only 1 path found and that's the path that Apache is already using.

How do I tell Apache to use 5.3?

  • Maybe too obvious, but did you restart Apache?
    – HBruijn
    Sep 2, 2016 at 13:08
  • only a couple dozens times :'(
    – Kiee
    Sep 2, 2016 at 13:09
  • 1
    I don't have access to an Ubuntu system atm but IIRC the Apache PHP module is a separate package named libapache2-mod-php, remove that. And the Q&A you link to mentions building PHP from source, is that what you did? Because you need additional ./configure options to build an apache module.
    – HBruijn
    Sep 2, 2016 at 13:15
  • Maybe your browser cached phpinfo page? Try clear browser cache and request page again.
    – Slezhuk
    Sep 2, 2016 at 13:17
  • @Slezhuk Not a chance!
    – Kiee
    Sep 2, 2016 at 13:18

2 Answers 2


Check your local path for php with which php - since you installed php from scratch, it is most likely not installed where you Apache finds it. Best ensure your version is the only one installed.

Remove all other versions: You can use dpkg -S $fileto find out which package a file belongs to. Most likely your Apache still uses the library from libapache2-mod-php5.

Install your wanted version as mod_php: Your build from scratch most likely did not include mod_php. Check with the included ./configure script if it is enabled before installing.


You need to change the php module apache is using.

sudo a2dismod php(yourversion)
sudo a2enmod php5.3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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