Apache using wrong version of PHP
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?
Solution 1:
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 $file
to 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.
Solution 2:
You need to change the php module apache is using.
sudo a2dismod php(yourversion)
sudo a2enmod php5.3