我确实安装了php7.4-mysql,错误在下面,其余在标题中
PHP致命错误:未捕获的错误:在{long_path} /index.php:9\nStack trace:\ n#0 {main} \ n中找不到类'mysqli',在线上{long_path} /index.php中9
是否有解决方案,还是必须重新安装并重新配置所有内容(这意味着我将通过备份再次降级到Ubuntu 18.04)?
答案 0 :(得分:1)
今天更新后,我遇到了同样的问题。我发现有些东西弄乱了,所以我尝试将其删除
apt remove php-mysqli
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, 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-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The 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 scour
Use '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 webmin
The following NEW packages will be installed:
libapache2-mod-php7.4 libpcre2-posix2 php7.4
The following packages have been kept back:
libomp-dev
The 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-pip
16 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
此后,我刷新了页面,它再次正常工作。
希望这会有所帮助,而且您并不孤单。
答案 1 :(得分:0)
将 php 升级到 7.4 对我有用。
sudo apt-get install php7.4