ThinkPHP Development Series 1 framework. In the initial stage, we only need to download one core package. We cannot use the extension package for the moment. we will download it later. Put the downloaded and decompressed ThinkPHP folder into the root directory of the project we created. at the beginning, we only need to download the core package. We cannot use the extension package for the moment. we will download it later. The downloaded and decompressed ThinkPHP folder is placed in the root directory of the project we created. We know that our project requires the front-end and back-end. First, create the Home and Admin folders.
When we deploy a website, the directory structure is often complicated due to the complexity of the project. The recommended deployment directory structure is as follows:
Directory/file description
ThinkPHP system directory (the following directory structure is the same as the system directory above)
Public website Public Resource Directory (stores Css, Js, images, and other resources of the website)
Upload Directory of the Uploads website (unified directory for user Uploads)
Home Project Directory (the following directory structure is the same as the application directory)
Admin background Management Project directory
...... More project directories
Index. php project Home entry file
Admin. php project Admin entry file
...... More project entry files
The grouping module can be simplified to a project directory.
Directory/file description
ThinkPHP system directory (the following directory structure is the same as the system directory above)
App project directory (the group directory structure will be described later)
Public website Public Resource Directory (stores Css, Js, images, and other resources of the website)
Upload Directory of the Uploads website (unified directory for user Uploads)
Index. php website entry file
The template file of the project is still placed under the Tpl Directory of the project, but the resource files for external calls, including image JS and CSS, are uniformly put under the Public directory of the website, storage in Images, Js, and Css sub-directories. if possible, you can even store these resource files in an external server for remote calls and optimization.
Here we select the second directory method. ThinkPHP requires an entry file, that is, index. php under the Project root directory. Content: // define the project name
// Define the project name
Define ('app _ name', 'app ');
// Define the project path
Define ('app _ path', './APP /');
/* Data Directory */
Define ('egojit _ DATA_PATH ','./data /');
/* Configuration file directory */
Define ('conf _ path', Egojit_DATA_PATH. 'config /');
// Load the framework input file
Require './ThinkPHP. php ';
The reason for choosing this group Directory is mainly because I think this group Directory is simpler and clearer. In this way, we request this website and you will find that many directories are automatically generated under the app directory. If it succeeds, you will see the picture
Bytes. We cannot use the extension package for the moment. we will download it later. Put the downloaded and decompressed ThinkPHP folder to the root directory of the project we created...