Score:0

How can i use a old version of PHP?

in flag

I am trying to use a old version of PHP - Specifically PHP 5.3.8 I really need to use this version, it is not possible to update it since the system is huge and it is very old - It needs to run on PHP 5.3.8.

So... Let's get to it:

About the Server Specs i am using:

O.S is Ubuntu 20.04 - I also tried all this on Debian Bullseye.

The things i tried so far: 1 Compiling from source 2 Using phpbrew 3 Few other methods that uses some repositories i found on some tutorials.

But this is been extremelly difficult to acomplish! Using phpbrew just feels impossible since everytime i try to install php 5.3.8 it gives me A LOT of erros, i go and i fix them but they will just keep appearing everytime... Really, i think i fixed like 20 different problems regarding packages compatibility and even some code directly on the source.

Had to even install some packages from source, like ICU for example!

Please, can someone point me in the right direction on what's the best way to do this????

I think i will try Docker next, but i DO NOT know how to start on Docker (Im new on the field.) I also know of a Software called ISPCONFIG but i'm not sure if it'ill work...

Please, any help, really, is much appreciate it! Thanks...

Liso avatar
sd flag
I don't know about phpbrew (never used them) but if you really need older PHP version, the only sure method of get them is by compiling from source. Once you did all the steps correctly, you should have the desired php version at your hand.
cn flag
Ray
I would suggest you install from source, which you can download it from [here](https://www.php.net/releases/index.php). It looks like 5.3.8 is from 2011...I guess what you have to do in order to compile php is to use a C/C++ compiler from around that time. I don't think I have many suggestions on how to do this since going back 10 years isn't going to be easy... (Though maybe if you can try the C/C++ compiler from just 5 years, that might be enough?)
in flag
I will give it a try... Thanks!
Score:0
sy flag

Here is what I have done to install php5.3 (5.3.29) to my Ubuntu 20.04

sudo cp ~/Downloads/php-5.3.29.tar.gz
cd /var/lib/php/modules
tar -xzvf php-5.3.29.tar.gz
  • Install php
cd php-5.3.29
./configure
sudo make
sudo make install

Error may occur with missing libxml2 after ./configure command, just install missing lib (sudo apt install libxml2-dev) then rerun ./configure after that you can continue with installation!

Check php -v

I found that you can't switch from this old php version to the new one if you have such :( So you will need to uninstall php5.3 to be able to use php5.5 or newer.

sudo apt-get install checkinstall
cd /var/lib/php/modules/php-5.3.29
sudo checkinstall
sudo dpkg -i php_5.3.29-1amd64.deb
sudo apt purge php

Credits to https://askubuntu.com/a/633684/1567452

Hope it will help!

Personally, I prefer using Docker though.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.