简体   繁体   English

Phalcon PHP模型未加载

[英]Phalcon PHP Models not being loaded

I have Phalcon php micro application setup on my dev machine and it is working fine. 我在我的开发机上安装了Phalcon php micro应用程序,并且运行正常。 However, I've pushed it to the production machine and it is saying it can't find any of the model classes. 但是,我已经将其推到生产机器上,并且说它找不到任何模型类。 I get the error 我得到错误

Fatal error: Class 'ItemType' not found in /var/www/html/api/index.php on line 115

The strange thing is nothing has changed except for the password to the database which I've updated so the app can log in. 奇怪的是,除了我已更新的数据库密码,该应用程序可以登录之外,没有任何更改。

I've setup all my registered directories also 我还设置了所有注册目录

$loader = new \Phalcon\Loader();
$loader->registerDirs(array(
    __DIR__ . '/models/',
    __DIR__ . '/decorators'
))->register();

What would be the reason for this? 这是什么原因呢?

Okay, so just found out that my dev machine is handling the file name differently. 好的,所以刚发现我的开发机器对文件名的处理方式有所不同。 It is case sensitive on the amazon machine. 在亚马逊机器上区分大小写。

My itemtype.php file needed to be ItemType.php . 我的itemtype.php文件必须是ItemType.php This goes with all model files. 所有模型文件都包含此文件。

Face palm. 脸掌。

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

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