2012-04-20 144 views
0

我使用cakephp 2.0和Wamp,它都很好。但是,生产服务器是unix Ubuntu。两台计算机都访问相同的mysql数据。 我有这些关系:调用成员函数find()对unix中的非对象错误只有

Model setup.php 
var $belongsTo = array('Client', 'User'); 

Model client.php 
var $hasMany = array('Setup'); 

Model user.php 
var $hasMany = array('Setup'); 

一切都在本地主机WAMP的伟大工程,但在生产服务器是UNIX ubunto,而我复制整个目录。搭配chmod 777的一切后,应用程序工作正常,除了这些错误:

Notice (8): Undefined index: Client [APP/View/Setups/index.ctp, line 38]

index.php line 38 
<td><?php echo $this->Html->link($setup['Client']['name'], array('controller' => 
'clients', 'action' => 'view', $setup['Setup']['client_id'])); ?>&nbsp;</td> 

Notice (8): Undefined index: User [APP/View/Setups/view.ctp, line 66]

view.php line 66 
<?php echo $this->Html->link($setup['User']['name'], array('controller' => 'users', 
'action' => 'view', $setup['User']['id'])); ?>` 

而且,当http://mailsender.asc/setups/add

Fatal error: Call to a member function find() on a non-object in
/disk/www/mailsender/app/Controller/SetupsController.php on line 69

SetupsController.php (line 69 is the "find" on add function) 
public function add() { 
// The relations belongs, has many etc. 
$users = $this->Setup->User->find('list'); 

(IT建议/蛋糕全部升级为了修复,它似乎修复了上述情况,但破坏了其他的东西,比如日志出并登录)。

任何人都可以帮忙吗?

我想知道是否有任何步骤,我应该把我的整个应用程序从Windows本地机到UNIX的Ubuntu。

预先感谢您! 最好的报价。

Carlos 来自Tijuana,墨西哥。

UNIX版本:

的Linux genesi 3.0.0-12 - 仿制PAE#20,Ubuntu的SMP周五10月7日16点37分17秒UTC 2011 i686的的i686 i386的GNU/Linux的

PHP版本: 本地主机:版本5.3.0 genesi(生产服务器):版本5.3.6-13ubuntu3.6

回答

0

users.php应该user.php(单数)

+0

user.php的确定。模型es user.php。这只是我的问题中的一个错字。 ---! ---- – 2012-04-21 03:43:20

相关问题