gpt4 book ai didi

mysql - Laravel 未定义的类常量 MYSQL_ATTR_LOCAL_INFILE

转载 作者:行者123 更新时间:2023-11-29 17:49:44 25 4
gpt4 key购买 nike

我收到错误。本地它可以工作,但不能在生产中使用。

有人有想法吗?

PHP版本7.1.14-1+ubuntu16.04.1+deb.sury.org+1

Mysql版本5.7.21

错误:

production.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Undefined class constant ‘MYSQL_ATTR_LOCAL_INFILE’ in /data/www/xxx/config/database.php:50

数据库:

    'default' => [
'driver' => 'mysql',
'host' => env('DB_HOST'),
'port' => env('DB_PORT'),
'database' => env('DB_DATABASE'),
'username' => env('DB_USERNAME'),
'password' => env('DB_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
'engine' => null,
'options' => array(
\PDO::MYSQL_ATTR_LOCAL_INFILE => true,
),
],

enter image description here

最佳答案

Install or enable PDO module using these commands

sudo apt-get install php7.1-mysql

sudo phpenmod pdo_mysql

sudo service apache2 restart

关于mysql - Laravel 未定义的类常量 MYSQL_ATTR_LOCAL_INFILE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49487776/

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