-1

i have a lampp stack on my Ubuntu 14.04 machine. It was installed from an apachefriends.org installer ages ago. As i can see in the binaries it has 2 PHP versions already installed with just a symlink for the actual php. Now i want to add a new PHP version (and keep the ones installed), in this case some 7.x on top of 5.x that are already present.

I think i could download and build/configure PHP but actually i have no idea how it would integrate into lampp with the existing versions. Particularly extensions, and possibly different config files. Would they use the same? Is it possible anyway?

patman
  • 2,780
  • 4
  • 30
  • 54

1 Answers1

1

For Ubuntu, follow:

Add PPA:

sudo add-apt-repository ppa:ondrej/php;
sudo apt-get update;
sudo apt-get upgrade;

Install Apache & MySQL (if not already installed):

sudo apt-get install apache2 mysql-server php-gettext php-xdebug;

Install PHP5.6 (if not already installed):

sudo apt-get install php5.6 php5.6-mysql php5.6-mbstring libapache2-mod-php5.6;

Install PHP7.1 (if not already installed):

sudo apt-get install php7.1 php7.1-mysql php7.1-mbstring libapache2-mod-php7.1;

Switching between PHP versions (via commands a2enmod & a2dismod):

Switch PHP Versions (7.1->5.6):

sudo a2dismod php7.1; sudo a2enmod php5.6; sudo service apache2 restart;

Switch PHP Versions (5.6->7.1):

sudo a2enmod php7.1; sudo a2dismod php5.6; sudo service apache2 restart;
Hossam
  • 1,126
  • 8
  • 19
  • apt update and upgrade should be in switched order: first update (updates the package list), then upgrade (installes new or updated packages) – cypherabe Apr 21 '17 at 13:35
  • Thanks for trying to help, but i know this. The question was meant differently because it would mean reinstalling lampp manually not integrating into an existing configuration (porting all of it would probably be a huge effort) - which is not installed from the repos, nor does the installed apache come with a2(en/dis)mod or thelike. Question was more if i could somehow get another php-binary that is usable by the old apache instance probably in the same (symlink) way – patman Apr 21 '17 at 13:49