cakephp控制器未找到生产服务器上的错误 [英] cakephp controller not found error on production server

查看:247
本文介绍了cakephp控制器未找到生产服务器上的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个cakephp项目下的文件夹FC下,在ubuntu,它的路径是 / var / www / FC / app /...
上传到ec2并进行所有配置更改,基本路径,即。 index.php正确打开,但是index.php上的任何其他链接都出现错误:


错误:找不到FCController。 / p>

错误:在文件中创建下面的FCController类:app / Controller / FCController.php




  class FCController extends AppController {

}


b $ b

创建此文件时,它会要求将方法位置放入类FCcontroller,并且在类中放置一个空方法时,显示会像空白页一样显示为蓝色。
因为我没有写这个代码我没有线索应该在这里的数据写...我该怎么办?

解决方案

我排序了问题。这是因为在我的代码中,以前的用户已经创建了一个控制器文件Locationscontroller.php和指定的URL如下:

  form id =0action =/ FC / locations / confirm_final> 

这是在我的本地计算机的localhost,其中基本文件夹是htdocs我不得不键入localhost / FC /访问index.php。
所以自然由于在EC2我已经使FC本身是我的基本文件夹,它试图访问另一个内部的FC,它不存在。 / XXX / locations /表示它搜索XXX控制器,然后查找其中的位置。由于我的控制器是Locations,它一直给出错误。



一旦我改变为:

 < form id =0action =/ locations / confirm_final> 

它指向正确的控制器是位置。
这是所有因为我没有检查哪个控制器被哪个View调用!
我是一个白痴,这将是所有:D


I have a cakephp project under folder FC such that on ubuntu, it's path is /var/www/FC/app/... Upon uploading to ec2 and making all configuration changes, the base path, ie. index.php is correctly opening but any other link on index.php is giving an error:

Error: FCController could not be found.

Error: Create the class FCController below in file: app/Controller/FCController.php

class FCController extends AppController {

}

Upon creating this file, it asks to put method locations into the class FCcontroller, and on putting an empty method in the class, the display goes blue like an empty page. Since I haven't written this code I have no clue where the data which should be here is written...what should I Do?

解决方案

i sorted the issue out. It was because in my code, the previous user had made a controller file Locationscontroller.php and specified urls like this:

<form id ="0" action="/FC/locations/confirm_final">

This was for localhost in my local machine where the base folder was htdocs I had to type localhost/FC/ to access index.php. So naturally Since on EC2 I had made FC itself my base folder, it was trying to access another FC inside it which didn't exist. The /XXX/locations/ means it searches for "XXX" controller and then locations inside it. Since my controller was Locations, it kept giving an error.

As soon as I changed it to this:

<form id ="0" action="/locations/confirm_final">

It pointed to the right controller which was locations. It was all because I didn't check which controller was called by which View! I'm an idiot, that'll be all :D

这篇关于cakephp控制器未找到生产服务器上的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆