错误:数据库连接"Sqlite"丢失,或无法创建Cakephp 2.9.0 [英] Error: Database connection "Sqlite" is missing, or could not be created Cakephp 2.9.0

查看:94
本文介绍了错误:数据库连接"Sqlite"丢失,或无法创建Cakephp 2.9.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用phpdesktop构建一个桌面应用程序.使用cake bake时遇到了Error: Database connection "Sqlite" is missing, or could not be created.这个问题.我能够连接到db并使用Controller获取数据行.

Hi I am building a desktop app using phpdesktop. I ran into this problem Error: Database connection "Sqlite" is missing, or could not be created. when using cake bake. I am able to connect to db and fetch a data-row using Controllers.

我主要担心的是,此问题是否会影响存储和检索数据或与应用程序的db功能相关的任何其他进程.

My major worry is if this problem is going to affect storing and retrieving data or any other process that is related to db functionality for the application.

我已经在论坛上搜索了有关信息,并尝试了大多数建议,但是没有一个建议可以奏效.如果有人知道如何解决此问题,我将不胜感激.

I have searched the forums for info with and tried most of the recommendations but none of them seams to work. I will appreciate if anyone has information on how to solve this problem.

我使用Windows和php 5.4.33. php.ini sqlite3.extension_dir中有一个变量,我尝试将其设置为完整路径,并且".""./"均未产生期望的结果.

I a using windows and php 5.4.33. There is a variable in php.ini sqlite3.extension_dir I have tried setting this to full path and also "." or "./" none of these produced a desire result.

推荐答案

我能够解决此问题.事实证明,蛋糕烘烤使用当前工作目录作为文件引用.就我而言,我从应用程序目录启动了烘烤功能,因此必须相对于此文件夹引用数据库文件.

I was able to solve the problem. It turns out that cake bake uses the current working directory for file references. In my case, I launched bake from the app directory so the database file has to be referenced relative to this folder.

我的数据库位于app/data中,因此使用的正确配置如下所示:

My db was located in app/data so the right configuration to use was as shown:

    public $default = array(
        'datasource' => 'Database/Sqlite',
        'persistent' => false,
        'database' => 'data/app_db.sqlite',
        'encoding' => 'utf-8',
    );

这篇关于错误:数据库连接"Sqlite"丢失,或无法创建Cakephp 2.9.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆