升级到 Ubuntu 20.04 后 PHP MySQLi 不再工作

我确实安装了 php7.4-mysql,错误在下面,其余在标题中

PHP 致命错误:未捕获错误:在 {long_path}/index.php:9 中找不到类“mysqli”\n堆栈跟踪:\n#0 {main}\n 在第 9 行的 {long_path}/index.php 中抛出

是否有解决方案,或者我是否必须重新安装和重新配置所有内容(这意味着我将通过备份再次降级到 Ubuntu 18.04)?


白猪掌柜的
浏览 120回答 2
2回答

翻翻过去那场雪

我今天更新后遇到了同样的问题。我觉得有些东西搞砸了,所以我试图将其删除apt remove php-mysqliReading package lists... DoneBuilding dependency treeReading state information... DoneNote, selecting 'php7.4-mysql' instead of 'php-mysqli'0 upgraded, 0 newly installed, 0 to remove and 19 not upgraded.然后我尝试了清除,并安装了完全相同的结果。最后,apt-get dist-upgrade 解决了我的问题。你可以看到升级让我的系统处于一种奇怪的状态,没有完全清除。apt-get dist-upgradeReading package lists... DoneBuilding dependency treeReading state information... DoneCalculating upgrade... DoneThe following packages were automatically installed and are no longer required:  apt-show-versions libapt-pkg-perl libauthen-pam-perl libimagequant0 libio-pty-perl libnet-ssleay-perl libpython-all-dev libpython2-dev  libpython2.7-dev libwebpdemux2 perl-openssl-defaults python-all python-all-dev python-automat python-certifi python-configparser python-constantly  python-crypto python-dbus python-entrypoints python-gi python-hyperlink python-keyring python-olefile python-pil python-xdg python2-dev python2.7-dev  python3-scour scourUse 'apt autoremove' to remove them.The following packages will be REMOVED:  libapache2-mod-php7.2 libapache2-mod-php7.3 libpcre2-posix0 libpython-dev libpython-stdlib minecraft-overviewer php7.2 php7.3 python python-click  python-colorama python-configobj python-dev python-incremental python-keyrings.alt python-minimal python-pip python-requests python-scour  python-secretstorage python-serial python-twisted-bin python-twisted-core python-urllib3 python-wheel webminThe following NEW packages will be installed:  libapache2-mod-php7.4 libpcre2-posix2 php7.4The following packages have been kept back:  libomp-devThe following packages will be upgraded:  libapache2-mod-php libpcre2-16-0 libpcre2-32-0 libpcre2-8-0 libpcre2-dev libpython-all-dev libpython2-dev libpython2-stdlib php python-all  python-all-dev python-pip-whl python2 python2-dev python2-minimal python3-pip16 upgraded, 3 newly installed, 26 to remove and 1 not upgraded.Need to get 2,675 kB/4,704 kB of archives.After this operation, 196 MB disk space will be freed.Do you want to continue? [Y/n] y之后我刷新了我的页面,它又开始工作了。希望这会有所帮助,而且您并不孤单。

青春有我

将 php 升级到 7.4 对我有用。sudo apt-get install php7.4
打开App,查看更多内容
随时随地看视频慕课网APP