2012-04-20 141 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

相關問題