Install php 5.4 on Ubuntu 16.04 Xenial

I want to install php5.4 on Ubuntu 16.04 (Xenial). I know this is deprecated, but I came across an old application that I need to check before updating the code for compatibility with php7.

When I do the following:

apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php5-oldstable
sudo apt-get update
sudo apt-get install -y php5

and check with php -v, it shows installed php5.6.

This is the result of php -v:

PHP 5.6.28-1+deb.sury.org~xenial+1 (cli) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
    with Xdebug v2.5.0rc1, Copyright (c) 2002-2016, by Derick Rethans

(The steps follow as http://tecadmin.net/install-php5-on-ubuntu/ )

Is there a way to force php5.4 to be installed instead of letting it select any php5 package it finds?

I tried with apt-get install -y php5.4, but this does not work.

. , , php7. - , , , ( !). , , , ! !

+4
1

** : ** . Ubu Vagrantfile. . , * nix.

, .


, Trusty Xeny scotch.io Vagrantfile (github link) . PHP 5.6. Linux , , Vagrantfile Ubu. Trusty Azure Xeny Vultr , -.

https://box.scotch.io/

https://github.com/scotch-io/scotch-box

git clone https://github.com/scotch-io/scotch-box.git my-project

Ubuntu 14.04 LTS (Trusty Tahr)
PHP 5.6
Ruby 2.2.x
Vim
Git
cURL
GD and Imagick
Composer
Beanstalkd
Node
NPM
Mcrypt

MySQL
PostreSQL
SQLite
MongoDB

Redis
Memcache and Memcached

Node

Grunt
Bower
Yeoman
Gulp
Browsersync
PM2

Laravel Stuff

Laravel Installer
Laravel Envoy
Blackfire Profiler

Mailcatcher

First: `vagrant ssh`
Run: `mailcatcher --http-ip=0.0.0.0`
Then visit: http://192.168.33.10:1080

WP-CLI
No Internet connection required
PHP Errors turned on
No Internet connection required
Laravel and WordPress ready
Operating System agnostic
+1

Source: https://habr.com/ru/post/1662826/


All Articles