开发者

Zend Autoloader does not work on actual site

开发者 https://www.devze.com 2023-02-14 23:11 出处:网络
having a problem! I\'m using Zend Quickstart application as basement for (just started lol) development.

having a problem! I'm using Zend Quickstart application as basement for (just started lol) development. I have PHP/MySQL server on my local machine (WinXP) So everything works fine there. But then I tried to upload my site to remote server. And this is what I get:

Fatal error: Class 'Default_Model_Post' not found in /home/mysite/application/controllers/IndexController.php on line 13

Line 13:

$post = new Default_Model_Post();

Default_Model_Post class is located at application/models/post.php And on my home server it is found by zend app!

I have checked .htaccess - there is SetEnv APPLICATION_ENV production line Here is my application.ini:

[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
autoloaderNamespaces[] = "Mysite_"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
resources.layout.layoutPath = APPLICATION_PATH "/layouts"
resources.db.adapter = "pdo_mysql"
resources.db.params.host = "localhost"
resources.db.params.username = "mysite_ib"
resources.db.params.password = "my passwd here"
resources.db.params.dbname = "mysite_ib"
resources.db.isDefaultTableAdapter = true

phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1

Here is Bootstrap.php:

<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
    protected function _initAutoload()
    {
        $autoloader = new Zend_Application_Module_Autoloader(array(
            'namespace' => 'Default',
            'basePath'  => dirname(__FILE__),
        ));
        //print_r( Zend_Loader_Autoloader::getAutoloaders()); exit; //tried to get some info here lol
        return $autoloader;
    }
}

Have checked everything I can imagine! It works on my dev machine but on real server - it does not! Have searched all over Google, Zend docs and stackoverflow but there's always not exactly my problem (or that fixes do not help). Also classes in Mysite_ namespace work fine even on real server. Site on the live server is total copy of my dev site (zipped -> uploaded -> unzipped with zend lib and so on) Please say how to fix this or开发者_运维百科 at least how to debug it... I'm sure there's some god damned server option that I have forgot to change. Guys I really rely on your help :( project of my dream is in ruins. Sorry for poor English.


Every thing looks normal in your post. the only one thing i could think of is make sure the name of the folder "models" is spelled lower case on your server.

You development machine is Windows, so these details may no matter on it but they do matter on Unix.


Your file name should be Post.php (capital "P").

As Atef mentioned, Windows file systems are case insensitive so a request for application/models/Post.php will resolve to your file.

On a *nix system, the request will fail as the file system is case sensitive.

0

精彩评论

暂无评论...
验证码 换一张
取 消