简体   繁体   English

Kohana 3.2:找不到类Model_Database

[英]Kohana 3.2: class Model_Database not found

I am getting this error when I try to run my code on server. 尝试在服务器上运行代码时出现此错误。

The error is for model file cities.php 错误是针对模型文件cities.php

The code in cities.php is as follows: city.php中的代码如下:

class Model_Cities extends Model_Database {}

It works fine on local server. 它在本地服务器上工作正常。 But gives error for production server. 但是给生产服务器错误。

Is kohana database module enabled on server in bootstrap.php? 在bootstrap.php中的服务器上启用了kohana数据库模块吗? Usually that file is slightly different on production than on local and sometimes you can forget to enable additional module etc. 通常,该文件在生产环境中与本地文件略有不同,有时您会忘记启用其他模块等。

You could check all loaded modules using: 您可以使用以下方法检查所有已加载的模块:

print_r(Kohana::modules());

You should see database module and path to it, then you can check that path and see if modules\\database\\classes\\model\\database.php file exist. 您应该看到数据库模块及其路径,然后可以检查该路径并查看是否存在modules \\ database \\ classes \\ model \\ database.php文件。 If path and file exist and was not changed then it should work. 如果路径和文件存在并且未更改,则它应该起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM