I had to do a Debian dist-upgrade on my server... in the process, PHP got upgraded to 5.4. We use ioncube which only supports up to 5.3 atm, and I'm having some trouble finding how to downgrade to 5.3 from 5.4. Anyone know how?
migrated from stackoverflow.com Mar 9 '12 at 2:02
This question came from our site for professional and enthusiast programmers.
Neither of the solutions above worked for me. What did work was pinning the necessary packages to the old stable such as
Add the following to
And add the packages you need downgraded such as in my case
Then run the commands
If you want to know which packages you need to upgrade just run :
You could try this, but do it at your own risk. I didn't try it myself. ;)
The last line to prevent upgrading to 5.4. When you're ready for 5.4, run
IonCube for 5.4 is a little while out from what I've read.
You can install both php versions parallel e.g. PHP 5.5x and 5.3x or even three PHP versions parallel e.g. PHP 5.5x , 5.4x and 5.3x using fastcgi.
1. Install Libs, fastCGI, git
2. Compile PHP and verify it
3. Configure FastCGI
Make this file executable.
4. Create a new virtual host
Put this into your host:
Add the domains to /etc/hosts
5. Test everything
Enable site and restart apache and create a new file with phpinfo() in /var/www/fastcgidemo to test your configuration.
Go to browser and type in fastcgidemo.dev
Hope it helps!
Full Tutorial on:
Downgrading PHP 5.4 to 5.3
First check which versions are supported for php5:
Here is the script which you could find it useful (it removes PHP 5.4 and install PHP 5.3):
Where the available versions you can check by command:
After the installation, verify it by command:
Please be careful and don't install any other packages without package version specified (like php5-xcache), otherwise apt-get will replace your PHP instance with 5.4 again!
To prevent this happening, you can hold these packages.
Holding packages using dpkg
To hold packages by dpkg, you can execute the following command:
To hold all PHP packages, run the following command:
The following command will show you holding status of your php packages:
Holding packages using aptitude
You can also hold packages using aptitude e.g.:
I had to do a full upgrade to wheezy by changing my apt sources to the wheezy sources. Uninstalled php, upgraded the system with the new apt sources, installed php... everything's golden.