As you know, you need an index. php file in the Web root directory. This file is used to process all requests on the page. It is used to set the application Program Running environment, ZF control system, and then start to execute the program. This is the frontend control mode. Create a file named "index. php" in the web_root folder, and enter Code
1 <? PHP
2 Error_reporting ( E_all | E_strict );
3 Ini_set ('Display _ errors ', True );
4 Date_default_timezone_set ('Europe/London ');
5
6 $ Rootdir = Dirname ( Dirname ( _ File __ ));
7 Set_include_path ( $ Rootdir . '/Library'. path_separator. Get_include_path ());
8
9 Require_once 'Zend/controller/front. php ';
10 Zend_controller_front: Run ('../application/controllers ');
11
12 ?>
Now let's take a look at more details of this file. Line 2-4 is used to set the system environment. The third line ensures that all errors or notes are printed. The fourth line is used to set the Default Time Zone (
I personally prefer to set the configuration information in the config file.) Include_path () is the requery (), include () and fopen_with_path () Methods to set the path for file search. You can set it in the PHP. ini file, but we don't have. You can use set_include_path (), just like Row 7. This is a boot file, and the core code is line 9-10. This initializes and calls the front-end controller. It distributes requests to the actions controller.