0

I'm running Ubuntu 14.04 through a pre-built vagrant box. The intent of the vagrant box is to operate as a LAMP stack, so it has PHP out of the box.

Running php -v returns this:

PHP 5.6.14-1+deb.sury.org~trusty+1 (cli) 

Running which php returns this:

/usr/bin/php

I'm trying to get to the latest stable build of PHP 5.6.x which is 5.6.28. From my understanding, if PHP was installed through APT package manager then I should just be able to run apt-get update however I'm guessing that PHP was configured on this vagrant box in a way that prevents that. I tried searching for a different package that might be suitable by using apt-cache search however nothing stands out.

I see that I can download the PHP release I want from http://php.net/downloads.php however that seems unorthodox when I'm accustom to updating through APT package manager. Do I need to remove whatever PHP version is currently installed and reinstall through APT? Thanks.

1 Answers1

1

Check your apt sources. You should have this file:

/etc/apt/sources.list.d/ondrej-php-trusty.list

If you don't, add it like this:

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

If you have any broken dependencies, check this post for more details.

If you end up following that, just note that where they suggest you use the ln -sfn command to switch php versions, you should really be using:

update-alternatives --config php