Tell me please

The goal is to change the environment (php version and only) for php scripts of the old project

Running scripts - will be done on the crown or from the console or via Apache

The choice of method - the choice fell on docker, because the latest version of ubuntu no longer supports php below 5.6, and the project is old

So far, I've learned how to run a version of php from a container

docker run -t -i php:5.4 /bin/bash root@c92c6b9786e5:/# php -i phpinfo() PHP Version => 5.4.45 

The question is how do I run the container (-d) so that php scripts can work on crown, or by opening n number of consoles could php be used ???

After all, in fact, the container daemon works with php, and php is not installed on the server

  • So, what prevents you from collecting the necessary version of PHP from the sources and launching it explicitly specifying the path to the console binary? - Ninazu 8:40 pm
  • clearly indicating the path to the console binary? @Ninazu how is this done? - Mcile 8:51 pm

1 answer 1

I just checked on the LinuxMint19 version (Ubuntu 18.04 Bionic) php5.3 works great

Old versions can be taken from here http://php.net/releases/

 sudo apt-get -y install build-essential libxml2-dev pkg-config wget http://pl.php.net/get/php-5.3.29.tar.bz2/from/this/mirror -O php-5.3.29.tar.bz2 tar jxf php-5.3.29.tar.bz2 cd php-5.3.29 ./configure --prefix=/opt/php-5.3.29 --with-config-file-path=/opt/php-5.3.29 make sudo make install 

Well, you can check the version so

 /opt/php-5.3.29/bin/php -v 
  • after that added sudo ln -f -s /opt/php-5.3.29/bin/php / etc / alternatives / php - Mcile