Home  >  Article  >  Backend Development  >  ubuntu 16.04 + apache2 switch php7.1 to php7.3

ubuntu 16.04 + apache2 switch php7.1 to php7.3

angryTom
angryTomforward
2019-11-01 12:01:532592browse

ubuntu 16.04 + apache2 switch php7.1 to php7.3

Background: When updating ubuntu, choose to retain the current php version, resulting in multiple php versions, and phpinfo displays php7.1. After checking with php -i, I found that many extensions cannot be opened.

1. How to switch version of php in Ubuntu16.04

sudo update-alternatives --config php

Select php7.3

2. Disable php7.1

sudo a2dismod php7.1
# Module php7.1 disabled.

3. Restart apache:

systemctl restart apache2

To activate the new configuration, you need to run:

systemctl restart apache2

4. When checking phpinfo, it is 7.3, and the extension does not report an error.

Recommended tutorial: PHP7 tutorial

The above is the detailed content of ubuntu 16.04 + apache2 switch php7.1 to php7.3. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete