简体   繁体   中英

"PHP Fatal error: Class 'AppController' not found" running CakePHP 2.0.5 on Windows IIS7

I have a CakePHP (version 2.0.5) app that runs perfectly in my MAMP development environment. When I deploy it to a Windows IIS7 server I get the following error for any page I try to load:

PHP Fatal error: Class 'AppController' not found in
[my path]\app\Controller\PagesController.php on line 8

If I install a totally clean/new version of CakePHP version 2.0.5 to that IIS server, it runs without error. The IIS log file shows me nothing useful. Here's what the first few lines of PagesController.php looks like:

<?php
App::uses('AppController', 'Controller');
/**
 * Pages Controller
 *
 * @property Page $Page
 */
class PagesController extends AppController {


    public function beforeFilter() {
        parent::beforeFilter();
        $this->Auth->allow('index','view','home');
    }
    ...

I'm at a loss as to what else I can check. Any ideas? And to pre-empt the inevitable "don't use Windows server" replies - if it were up to me, I wouldn't.

usually that is a 2.1 problem but take a look at: http://book.cakephp.org/2.0/en/appendices/2-1-migration-guide.html

=> your controller has to be in your APP now (it is not part of the core anymore)- so just create one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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