更新时间:2022-03-27 05:54:02
请检查您是否在系统中安装了多个php版本,其中一个正在为Web服务器运行,另一个正在为php CLI运行,并且对Web和php使用PHP_INFO- -ini在命令行中,如果找到了不同的版本,则升级或降级意味着将其配置为一个版本,并确保在系统中启用了PDO.
Please check you have installed more than one php version in your system, one is running for web server and another for php CLI, using PHP_INFO for web and php --ini in commandline, if different version found then upgrade or downgrade means make it one version configuration, and make sure PDO is enable in your system.
从php5.6到php7.0:
From php5.6 to php7.0:
Apache:
sudo a2dismod php5.6 ; sudo a2enmod php7.0 ; sudo service apache2 restart
CLI:
sudo update-alternatives --set php /usr/bin/php7.0
From php7.0 to php5.6:
Apache:
sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart
CLI:
sudo update-alternatives --set php /usr/bin/php5.6