Original link http://www.yii-china.com/post/detail/1.html
Project Construction:
Click on "Resources download" above to download the yii2.0 Premium Framework required for this tutorial
After the download, there is an advanced folder after decompression, open to get the directory as shown
The description of the directory structure is not detailed here, we mainly know three directories backend (backstage), Common (public), frontend (foreground).
Open C:\Windows\System32\drivers\etc\hosts to copy the following code into the Hosts file (for example)
127.0.0.1 admin.demo.com 127.0.0.1 www.demo.com
-
Copy the advanced project file extracted above to the environment root, configure access directory, open \apache\conf\extra\httpd-vhosts.conf (restart Apache service after modification)
<VirtualHost *:80> documentroot "F:\pro\advanced\frontend\web" ServerName www.demo.com serveralias www.demo.com </virtualhost> <virtualhost *:80> documentroot "F:\pro\advanced\backend\web" Servername admin.demo.com serveralias admin.demo.com </virtualhost>
Note: F:\pro is my local environment root directory, Depending on the actual situation of the respective environment
Adding Php.exe to System environment variables
Steps:
1. Right-click My Computer-Properties-advanced-environment variables
2. Find the path (may need to scroll down to find), the mouse double-click the path, in the end to add your PHP directory and the class library where the path, including the previous ";" (For example:; C:\php; C:\php\ext)
3. Click the "New" button and enter "PHPRC" in "Variable name" to enter the directory where the php.ini file is located (for example: C:\php) in the variable value, this step is to let Windows find php.ini.
4. Run cmd into the installation directory, execute init or run Init.bat in the installation directory, select 0 Development mode for installation
Open the browser to access http://www.demo.com can see the foreground interface, http://admin.demo.com is the background interface (there is a login interface)
Original link http://www.yii-china.com/post/detail/1.html
Yii2.0-advanced Advanced Edition Project Construction (i)