Zend Framework 1.10 库文件夹中的自定义类未找到
我正在从 zendCast 学习 zend 框架,但找不到
我正在使用的问题:
-Zend Server CE
-Zend Studio 7.2
-Zend Framework 1.10 (使用 zend studio 创建)
在我的库文件夹中,我有一个文件夹 App ,其中文件夹中有一个与 App_Countries 类相对应的 php 文件 Country.php,但是当我尝试创建一个新的 App_Countries 对象时,它说无法加载该类,关于如何消除该错误有什么想法吗?
Fatal error: Class 'App_Countries' not found in /usr/local/zend/apache2/htdocs/ZC/application/controllers/IndexController.php on line 14
索引.php
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()
->run();
I'm learning zend framework from zendCast and can't find the problem
I'm using:
-Zend Server CE
-Zend Studio 7.2
-Zend Framework 1.10 (created with zend studio)
In my library folder I have a folder App and in that folder a php file Countries.php which corresponds to App_Countries class but when I try to create a new App_Countries object it says that class could not be loaded any ideas on how to get rid of the error?
Fatal error: Class 'App_Countries' not found in /usr/local/zend/apache2/htdocs/ZC/application/controllers/IndexController.php on line 14
index.php
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()
->run();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保在 application.ini 中正确配置了 autoloader 命名空间。
它应该包含这样的内容:
Make sure the autoloadernamespace is properly configured in your application.ini.
It should contain something like this: