gpt4 book ai didi

php - 无法连接到 mysql - 在 InMotion 托管上使用 PHP 7.1 设置 Laravel 5.8 时出错。多 PHP 版本

转载 作者:行者123 更新时间:2023-11-29 15:43:27 24 4
gpt4 key购买 nike

我似乎无法使用 PHP 7.1laravel 5.8 让 laravel 连接到 MySQL

错误:

Illuminate \ Database \ QueryException could not find driver (SQL: select * from users

我在使用 php 5.6laravel 5.4 时没有遇到此问题,但我宁愿使用新版本!

我做到了:

composer update

composer require doctrine/dbal

并在php.ini中包含了extension=pdo_mysql.so以及重新启动apache

最佳答案

好的,这已修复:

服务器的 PHP 配置已切换到 Apache MPM 的“Event”而不是“Prefork”,因为 Prefork 通常只在运行 Opcache 的非 FPM 服务器上需要。

还在我运行 php 7.1 的网站上启用了 FPM,因为在单独的 PHP 版本上运行 Opcache 时通常需要它。

关于php - 无法连接到 mysql - 在 InMotion 托管上使用 PHP 7.1 设置 Laravel 5.8 时出错。多 PHP 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57335185/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com