Report this

What is the reason for this report?

How to upgrade from PHP v.5.5.9 to v.5.6

Posted on September 30, 2014

I just deployed a new droplet. By default, it’s set up with PHP 5.5.9. I would like to upgrade that to v.5.6.

How do I do this?

Thanks in advance.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

note that if you are using NGINX and not Apache, this needs to be changed to avoid apache being loaded as part of the install. According to the maintainer of the ppa, the correct approach is to replace

sudo apt-get install php5

with

sudo apt-get install php5 php5-fpm

in the provided sequence of commands

I have followed this guide but seem to have run into problems:

I did the following:

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php5.6

Now what seems to have happened is when I check phpinfo.php it is using 5.5.9 but the cli is using 5.6.24

When I use composer install, It seems all my extensions (intl, mbstring, zip etc…) are not installed. I am a bit lost and would really appreciate any advice :-)

Thanks

Aaron

I followed your instructions but keep getting E: Couldn’t find any package by regex ‘php5.6’

How to fix this?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.