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!