我在Nginx上运行Lumen,PHP 5.6 ec2。
当我尝试进行数据库查询时出现此错误。
PDOException in Connector.php line 55:
could not find driver
这是我的.env文件
APP_ENV=local
APP_DEBUG=true
APP_KEY=appkey
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
DB_CONNECTION=mysql
DB_HOST=mydb****.cdsfsdf***.ap-southeast-1.rds.amazonaws.com
DB_PORT=3306
DB_DATABASE=db_name
DB_USERNAME=db_user
DB_PASSWORD= password
CACHE_DRIVER=memcached
SESSION_DRIVER=memcached
QUEUE_DRIVER=database
# MAIL_DRIVER=smtp
# MAIL_HOST=mailtrap.io
# MAIL_PORT=2525
# MAIL_USERNAME=null
# MAIL_PASSWORD=null
# MAIL_FROM_ADDRESS=null
# MAIL_FROM_NAME=null
# FILESYSTEM_DRIVER=local
# FILESYSTEM_CLOUD=s3
# S3_KEY=null
# S3_SECRET=null
# S3_REGION=null
# S3_BUCKET=null
# RACKSPACE_USERNAME=null
# RACKSPACE_KEY=null
# RACKSPACE_CONTAINER=null
# RACKSPACE_REGION=null
我该如何解决这个问题?代码在我的本地主机上完美运行。
答案 0 :(得分:0)
检查是否安装了php-mysql模块。
rpm -q php-mysql -l
如果未安装,请运行此命令:
yum install php56-mysqlnd