Php 推进:没有可用于myproject数据库的连接

Php 推进:没有可用于myproject数据库的连接,php,propel,Php,Propel,我在执行时出错 $ ./propel model:build --verbose Processing: schema.xml 1 tables processed successfully 1 tables found in 1 schema files. Generating PHP files... Datamodel: ./schema.xml - Database: myproject + Table: resource -> (unchanged) /

我在执行时出错

$ ./propel model:build --verbose
Processing: schema.xml
  1 tables processed successfully
1 tables found in 1 schema files.
Generating PHP files...
Datamodel: ./schema.xml
 - Database: myproject
  + Table: resource
        -> (unchanged) /Base/Resource.php
        -> (unchanged) /Map/ResourceTableMap.php
        -> (unchanged) /Base/ResourceQuery.php
        -> (exists) Resource.php
        -> (exists) ResourceQuery.php
                (no change)
Object model generation complete - All files already up to date
$ ./propel sql:build --verbose
Processing: schema.xml
  1 tables processed successfully
1 tables found in 1 schema files.
$ ./propel sql:insert --verbose
No connection available for myproject database
$
输出为:

没有可用于myproject数据库的连接

以下是我感兴趣的3个文件:

我错过了什么


谢谢。

您的构建中可能缺少这些属性:

propel.runtime.conf.file   = runtime-conf.xml
propel.buildtime.conf.file = buildtime-conf.xml

您的buildtime-conf.xml与您的runtime-conf.xml非常相似,因此您可以复制、重命名并查看它是否有效。

谢谢,它有效。文档中提到的位置?除了一点小费?你会发现的我看到了。它描述了要使用的buildtime配置文件名,并提到如果使用多个数据库,则需要buildtime-conf.xml。我只用一个。我只是说文档中有点不清楚。它有点自我描述。。。构建时conf用于“构建”类,即在迁移/架构更改期间;运行时conf用于运行应用程序时,从runtime-conf.xml生成conf/{project}-conf.php。这只是你曾经处理过的事情之一,把它做好,然后忘掉它。