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

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

angryTom
Release: 2023-02-17 12:58:01
forward
2630 people have browsed it

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
Copy after login

Select php7.3

2. Disable php7.1

sudo a2dismod php7.1
# Module php7.1 disabled.
Copy after login

3. Restart apache:

systemctl restart apache2
Copy after login
Copy after login

To activate the new configuration, you need to run:

systemctl restart apache2
Copy after login
Copy after login

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!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template