I have a magento 2.2.2 and want to update to magento 2.3. The problem is my version of php. Currently I have php7.1.26 while magento 2.3 is compatible only with php 7.1.3+. The solution seems easy: upgrade my php version to 7.1.3. My problem is that I cannot find a way to do this.

I first tried the usual way with the update command:

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.1

This switched my php version from php7.1.14 to php7.1.26. But I need php7.1.3 so this is not good. So I tried this:

sudo apt-get install php7.1.3

but this installed php7.2 instead. I need php7.1.3 so this is not good either.

So my question now is:

Is there a way to have a php version 7.1.3+ but not 7.2+ ?


  • I think some links can help you: stackoverflow.com/questions/42619312/… and askubuntu.com/questions/761713/… – Khoa TruongDinh Jan 24 at 1:50
  • Hi, thanks for your answer, however I don't see how they might be helpful. The first link is to switch between two different installed php version but my problem is that I cannot even install the version of php I want. The second link just give me the procedure to install the php version I want, but I've already tried it and it doesn't work: this procedure gave me php 7.1.26 but I need the 7.1.3 – Lounik Jan 25 at 7:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.