0

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. – Khoa TruongDinh Jun 6 at 7:36
  • Can you please suggest me how to do so – Paras Arora Jun 6 at 7:37
  • How many PHP version on your system? – Khoa TruongDinh Jun 6 at 7:38
  • /usr/bin/ shows php7.0 , php7.1 , php7.3 ------- I want to use 7.1 – Paras Arora Jun 6 at 7:39
  • 1
    Google will help you. For example: ostechnix.com/… – Khoa TruongDinh Jun 6 at 7:43
0

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
0

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, privacy policy and cookie policy

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