2

I'm upgrading the php version to 7.0 in my docker image which is based on Ubuntu 14.04. I read some articles giving the commands to uninstall php5 while installing php7.0. Is this really necessary? What are the pros and cons?

7
  • 3
    Is there something wrong with using the versions on hub.docker.com? Commented Nov 15, 2016 at 14:13
  • You can have both installed, just make sure that your files point to the right version, or that the correct version is in your PATH. Commented Nov 15, 2016 at 14:14
  • 2
    Questions on professional server- or networking-related infrastructure administration are off-topic for Stack Overflow unless they directly involve programming or programming tools. You may be able to get help on Server Fault. Commented Nov 15, 2016 at 14:16
  • @jay I'm a developer not a devops. That's why I tend to use stackoverflow. However, if the question does not fit stackoverflow requirements I can delete it. Commented Nov 15, 2016 at 16:16
  • @JonStirling when I don't need to make a specific image I use the images available on dockerhub. However, sometimes, I need to install different softwares, activate modules and so on. In these situations, it's necessary to write your own image. Commented Nov 15, 2016 at 16:19

1 Answer 1

6

add the new repository for PHP 7:

 apt-get install software-properties-common
 add-apt-repository ppa:ondrej/php

remove PHP 5 from your system and install PHP 7

 apt-get update && apt-get purge php5-fpm && apt-get --purge autoremove && apt-get install php7.0-fpm php7.0-mysql php7.0-curl php7.0-gd php7.0-json php7.0-mcrypt php7.0-opcache php7.0-xml

see this article for more details

https://bjornjohansen.no/upgrade-to-php7

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.