Zend Framework配置文件位于application->configs目录下application.ini文件,默认有4组配置,即开发(development)、测试(testing)、演示(staging)、上线(production)
[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
[staging : production]
[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1
新建的Zend Framework项目默认使用上线的配置,因此错误消息不会出现,给初学者造成不少麻烦,因此对照开发的配置(如下),将上线的配置同样的3行的值改成1。
;开启错误调试,请将下面前三项设为1
[production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
;数据库设置
[mysql]
db.adapter=PDO_MYSQL
db.params.host=localhost
db.params.username=root
db.params.password=
db.params.dbname=votedb