3

I want to install magento 2 on Ubuntu. I upgrade my PHP version to 7.1.3 and when I execute command to check php version I am getting below output:

PHP 7.1.3-3+deb.sury.org~trusty+1 (cli) (built: Mar 25 2017 14:24:10) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.1.3-3+deb.sury.org~trusty+1, Copyright (c) 1999-2017, by Zend Technologies

When I am trying to install Magento 2.1.x, I am gettig php version 5.5.9-1ubuntu4.21.

Please check below screenshots for referance.

enter image description here and because of this i am unable to proceed.

  • Are you incorrectly checking the PHP version of the Server? not your localhost Those modules look like the ones often missing on WAMP. – MackieeE Apr 10 '17 at 11:54
  • I am checking on my localhost.. open cmd and execute commang php -v – Krupali Apr 10 '17 at 11:55
  • Have you try to check php version with phpinfo() in your server? What it show to you? – Dhiren Vasoya Apr 10 '17 at 11:58
  • It showing 5.5.9-1ubuntu4.21 – Krupali Apr 10 '17 at 12:03
  • 1
    Please restart your apache server – Nalin Savaliya Apr 10 '17 at 12:07
2

For upgrading PHP version you can go through following steps Run the following command if you are using linux:

For PHP 5.5, PHP 5.6 and PHP 7.0:

sudo apt-add-repository ppa:ondrej/php

For PHP 5.4 (Deprecated, upgrade at least to PHP 5.5):

sudo apt-add-repository ppa:ondrej/php5-oldstable

For PHP 5.5 (Deprecated, use ppa:ondrej/php):

sudo apt-add-repository ppa:ondrej/php5

For PHP 5.6 (Deprecated, use ppa:ondrej/php):

sudo apt-add-repository ppa:ondrej/php5-5.6

sudo apt-get update

If you are WAMP user then refer following link https://john-dugan.com/upgrade-php-wamp/

Missing extension error

For any missing extension you just need to go php.ini and remove find that extension from the file and remove the semicolon from that line Or if you are on local machine then you can click on wamp,xamp and mamp icon. Go to PHP extensions – > find the missing extension and click on it then restart the server. Following screenshot show how we can do it using wamp.

enter image description here

INSTALL EXTENSION

 sudo apt-get install php7.0-intl
 sudo apt-get install php7.0-xsl

If you have already upgrade then please run following commnad and restart apache:

sudo apt-get update

sudo /etc/init.d/apache2 restart

To switch from 5.5 to 7

 $ sudo a2dismod php5.5 
 $ sudo a2enmod php7.1 
 $ sudo service apache2
 restart

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.