PHP 致命错误 Zend 未捕获异常

PHP 致命错误 Zend 未捕获异常

我正在使用 Zend Framework 1.11 开发托管在 CentOS 服务器上的网站。Apache 正在运行,documentroot 设置为“var/www/html/public”。当我将 index.php 文件从 Zend Framework 项目复制到此目录并浏览到http://www.localhost什么都没有出现,浏览 localhost/html/public/index.php 时也是如此。

我注意到需要将 Zend Framework 文件夹复制到 /usr/share/php/Zend,但直到今晚我创建它时,它才存在。将 Zend 文件夹复制到那里后,我的浏览器仍然显示空白页。我使用 php -f /var/www/html/public/index.php 并收到以下错误:

PHP Fatal error:  Uncaught exception 'Zend_Config_Exception' with message    
'parse_ini_file(/var/www/html/application/configs/application.ini): failed to open
stream: No such file or directory' in /usr/share/php/Zend/Config/Ini.php:182
Stack trace:
#0 /usr/share/php/Zend/Config/Ini.php(202): Zend_Config_Ini->_parseIniFile('/var
/www/html/a...')
#1 /usr/share/php/Zend/Config/Ini.php(126): Zend_Config_Ini->_loadIniFile('/var
/www/html/a...')
#2 /usr/share/php/Zend/Application.php(386): Zend_Config_Ini->__construct('/var
/www/html/a...', 'production')
#3 /usr/share/php/Zend/Application.php(85): Zend_Application->_loadConfig('/var
/www/html/a...')
#4 /var/www/html/public/index.php(24): Zend_Application->__construct('production',
'/var/www/html/a...')
#5 {main}
thrown in /usr/share/php/Zend/Config/Ini.php on line 182

周四的截止日期马上就要到了,我迫切需要了解如何才能解决这种情况。有人能帮忙吗?

谢谢

答案1

从错误消息中可以得出这个问题的简短答案,即您在目录中没有应用程序 ini 文件/var/www/html/application/configs。您需要知道项目配置文件的位置。如果没有更详细的信息,很难提供更好的帮助,尽管一个好的起点是相关的Zend_ApplicationZend 程序员参考指南中的部分。

相关内容