1
votes

So here is the case . I have baked the cake php application normally . The site runs fine on a local server . But when migrated to bluehost server it starts having issues in hasmany and belongs to associations . The issue i found was basically in the array containing the data. E.g $comments usually has the data

Array ( [Comment] => Array ( [id] => 46 [name] => asddasd [email] => sdaa [website] => asdasd [commentdata] => asdasd [postdate] => 2012-04-27 08:20:00 [post_id] => 2 ) [Post] => Array ( [id] => 2 [title] => Fighter Aircraft [category] => Military [description] => asddasdasdasdasdasd [body] => Hello this is second [created] => 2012-04-10 18:41:43 [modified] => 2012-04-27 13:25:33 [user_id] => 0 ) )

but on the webserver it looks like

Array ( [Comment] => Array ( [id] => 8 [name] => ddasdasdsdasd [email] => asdasd [website] => asdasd [commentdata] => adasdasdasdad [postdate] => 2012-04-23 23:15:00 [post_id] => 8 ) )

Thus ending up showing following error

Undefined index: Post [APP/View/Comments/index.ctp, line 24] The line 24 is

    <?php echo $this->Html->link($comment['Post']['title'], array('controller' => 'posts', 'action' => 'view', $comment['Post']['id'])); 

Please tell a fix for this ?

1
Isn't this the same as your other question: stackoverflow.com/questions/10437939/…?w0051977
yes it is the same but i am not getting a good solution for this silly problem ! .Sumit Singh Bir
What version of PHP do you have on your PC and what version of PHP is on the server? What Operating System is on your PC and what Operating System is on the server? What host are you using? Do they support your setup?w0051977
both the version of cakephp are the same . i am using windows pc . and hosting on bluehost . they support the setup . i guess bluehost uses linux osSumit Singh Bir
Have a look at the link I have provided in my answer below.w0051977

1 Answers

0
votes

Have a look at this tutorial: http://ad7six.com/2007/08/24/Production-setup-revisited.html. I have seen this question posted quite a lot on this site, namely: here: Cakephp Install on Bluehost and here: Setting up cakephp 2.0 on bluehost