Home  >  Article  >  Backend Development  >  PHP version coexistence

PHP version coexistence

不言
不言Original
2018-04-16 13:46:351617browse

This article mainly introduces the content about the coexistence of PHP versions, which has certain reference value. Now I share it with everyone. Friends in need can refer to it

1. Update source ubuntu


sudo add-apt-repository ppa:ondrej/phpsudo apt upgradesudo apt update
下载php7.1的命令

sudo apt-get install -y php7.1-common php7.1-mbstring php7.1-mcrypt php7.1-mysql php7.1-xml php7.1-gd php7.1-curl php7.1-json php7.1-fpm php7.1-zip php7.1-mcrypt libapache2-mod-php7.1
;; 开启一个php版本sudo a2enmod php7.1
;; 禁用一个php版本sudo a2dismod php7.1
;; 重启Apache2sudo service apache2 restart

PHP Undefined class constant 'MYSQL_ATTR_INIT_COMMAND' solution

Modification

php.ini
extension=php_pdo.dll //开启PDO      
extension=php_pdo_mysql.dll //PDO 访问mysql 驱动

Related recommendations:

php version switching Detailed process and common php-fpm FAQs in online Linux environment

The above is the detailed content of PHP version coexistence. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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
Previous article:php encryption functionNext article:php encryption function