on my ubuntu 16 server i have installed php and it show version

PHP 7.1.30-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: May 31 2019 11:43:14) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.1.30-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

but when I run phpinfo() it show

PHP Version 7.0.33-8+ubuntu16.04.1+deb.sury.org+1

  • PHP CLI has a different version with PHP for web server. Please try to upgrade your PHP version. Commented Jun 6, 2019 at 7:36
  • Can you please suggest me how to do so Commented Jun 6, 2019 at 7:37
  • How many PHP version on your system? Commented Jun 6, 2019 at 7:38
  • /usr/bin/ shows php7.0 , php7.1 , php7.3 ------- I want to use 7.1 Commented Jun 6, 2019 at 7:39
  • 1
    Google will help you. For example: ostechnix.com/… Commented Jun 6, 2019 at 7:43

2 Answers 2


We can have multiple php version kindly use below command to check list of your version and select the suitable one

sudo update-alternatives --config php

activate php 7.1

sudo a2dismod php7.1

de-activate php 7.0 php 7.3

sudo a2enmod php7.0

sudo a2enmod php7.3

this configuration works for me

Your Answer

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

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