serverless-components / tencent-thinkphp

Tencent Cloud ThinkPHP Serverless Component
MIT License
10 stars 5 forks source link

could not find driver #4

Closed zouxingjie closed 4 years ago

zouxingjie commented 4 years ago

我用部署的thinkphp 连接 postgresql 的serverlessDB 版本 但是没有成功 查看请求日志 报错 “could not find driver”。thinkphp 与 serverlessDB 我是分开部署 也都配置到了一个子网里。 日志:

START RequestId: 0fd7131539ae8f4cc3a8cf92f00d143a

Event RequestId: 0fd7131539ae8f4cc3a8cf92f00d143a

[2020-06-14T15:06:24+08:00][error] [0]could not find driver

[2020-06-14T15:06:24+08:00][error] [0]could not find driver

[2020-06-14T15:06:24+08:00][error] [0]Return value of think\log\driver\File::write() must be of the type boolean, null returned

[2020-06-14T15:06:24+08:00][error] [0]could not find driver

[2020-06-14T15:06:24+08:00][error] [0]Return value of think\log\driver\File::write() must be of the type boolean, null returned

[2020-06-14T15:06:24+08:00][error] [0]Return value of think\log\driver\File::write() must be of the type boolean, null returned

[2020-06-14T15:06:24+08:00][error] [0]could not find driver

怎么样才能连接上数据库呢?

tinafangkunding commented 4 years ago

@zouxingjie 您好,这个问题主要是 云函数的 PHP 环境里没有支持 driver 的原因造成的。可以参考这个 issue https://github.com/serverless-components/tencent-laravel/issues/7

zouxingjie commented 4 years ago

你好,我参考了之前这个issue 但还是不理解如何 连接pgsql数据库。请问能不能直接把云函数 的php 运行环境 的pdo_pgsql扩展打开呢?

yugasun commented 4 years ago

目前云函数 PHP runtime 不含有 pdo_pgslq 扩展,所以暂时没法使用 PostgreSQL。