0

How can l install php 5.4 instead of php 5.6 in ubuntu 15.10? Is it possible to make it without phpbrew? I found this:

sudo add-apt-repository ppa:ondrej/php5-oldstable
sudo apt-get update
sudo apt-get install php5

but as far i know it's not working since ubuntu 13.10

5
  • why do you want php5.4 ?
    – Neil
    Oct 28, 2015 at 3:57
  • it used in my project
    – Torondor
    Oct 29, 2015 at 11:50
  • @Torondor PHP 5.6 can perfectly run code you wrote for 5.4. With extremely tiny exceptions.
    – Evert
    Oct 29, 2015 at 17:18
  • Okay the above Answer works: I just don't have enough "reputation points" to put the damn response there. Few tips: 1.) You have to compile Apache httpd as well as pcre before compiling php. 2.) The default www Dir of Apache is /usr/local/apache2/htdocs as it's a UNIX install on Ubuntu so little different. I am running: Maui 1 Aurora (Ubuntu 16.x.x variant) hope this helps.
    – morleman
    Aug 16, 2016 at 19:14
  • PHP 5.6 can do all the tasks needed for 5.4 Jan 12, 2017 at 12:14

1 Answer 1

0

Finding a supported PPA or DEB is usually the best route, but as a last resort, I used to have moderate success compiling PHP from source.

Sourcecode: http://php.net/downloads.php#v5.4.45

Detailed Official Instructions: http://php.net/manual/en/install.unix.apache2.php

cd ../php-NN
./configure --prefix=/usr/local/php54 --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql
make
make install

etc. You need the apache2-dev package to link the source.

By using --prefix=, you can have multiple versions of PHP installed at once.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .