繁体   English   中英

Cake PHP网站在localhost上正常运行,但在服务器上时出错

[英]Cake PHP site working fine on localhost but error when on server

情况就是这样。 我已经正常烘烤了蛋糕php应用程序。 该站点在本地服务器上运行良好。 但是,当迁移到bluehost服务器时,它开始在hasmany中出现问题并属于关联。 我发现的问题基本上是在包含数据的数组中。 例如,$ comments通常具有数据

Array([Comment] => Array([id] => 46 [name] => asddasd [email] => sdaa [website] => asdasd [commentdata] => asdasd [postdate] => 2012-04-27 08 :20:00 [post_id] => 2)[Post] =>数组([id] => 2 [title] =>战机[类别] =>军事[描述] => asddasdasdasdasdasd [body] =>您好,是第二个[创建] => 2012-04-10 18:41:43 [修改] => 2012-04-27 13:25:33 [user_id] => 0))

但是在网络服务器上

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

因此最终显示以下错误

未定义的索引:发布[APP / View / Comments / index.ctp,第24行]第24行是

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

请为此解决吗?

看看本教程: http : //ad7six.com/2007/08/24/Production-setup-revisited.html 我已经看到这个问题在此站点上发布了很多,即:此处: 在Bluehost上安装Cakephp和此处: 在bluehost上设置cakephp 2.0

暂无
暂无

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

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