How to perform local development and testing of AnQiCMS in Windows environment?
As an experienced website operator who deeply understands the operation of AnQiCMS, I fully understand the importance of thorough local development and testing before formal launch to ensure the quality of website content, user experience, and system stability.Set up an efficient AnQiCMS local development environment under the Windows environment, which allows you to freely create, edit, publish, and optimize content, while also conducting various functional tests, thereby greatly improving work efficiency.
The detailed explanation of how to carry out local development and testing of AnQiCMS in the Windows environment will be provided to you.
Develop and test AnQiCMS locally in the Windows environment: detailed guide
Preparation
Before you start setting up your local development test environment, there are several necessary preparations to be completed.First, you need to download the latest Windows version installation package from the AnQiCMS official website.Choose a stable version compatible with your Windows system to ensure the smooth progress of subsequent steps.
Secondly, to simplify the configuration of the local server environment, it is strongly recommended to install an integrated development environment (IDE), such as PHPStudy (also known as Small Skin Panel).PHPStudy integrates components required for Nginx, MySQL, and other Web services, and provides an intuitive graphical user interface, which can significantly reduce the complexity of environment configuration, allowing you to focus more on the development and content management of AnQiCMS itself.
Moreover, a fully functional text editor (such as Visual Studio Code, Sublime Text, etc.) is indispensable, which will be used to edit the configuration files and template files of AnQiCMS.At the same time, you also need a modern web browser (such as Chrome, Firefox, Edge, etc.) to access, test, and debug websites.
Configure the local development environment
We will take PHPStudy (Xiao Pi Panel) as an example to guide you in configuring the local environment.If you have not installed PHPStudy yet, please install it first according to their official instructions.
First, create a new local website in PHPStudy.Open the PHPStudy control panel, navigate to the "Website" management interface, and click the "Create Website" button.In the pop-up configuration window, you need to fill in a local domain name, such asdev.anqicms.com。PHPStudy will be in the root directory of the website you set (usuallyC:/phpstudy_pro/WWW/A folder corresponding to the domain name is automatically generated. Please remember the complete path to the root directory of this website.
AnQiCMS's web service usually starts from the project'spublicThe subdirectory provides static resources. Therefore, in the configuration of your newly created website, you need to point the 'runtime directory' or 'site root directory' of PHPStudy to the root directory of your website.publicFolder, for exampleC:/phpstudy_pro/WWW/dev.anqicms.com/public. After completing this setting, please save the changes and restart the Nginx service in PHPStudy to ensure the configuration takes effect.
Deploy AnQiCMS core files
After you have completed the configuration of your local website, the next step is to deploy the AnQiCMS program files to the correct directory. Please transfer all the files (including theanqicms.exean executable file,templateFolder,publicFolder and other related files) Copy and paste them into the root directory of the website you created in PHPStudy, for exampleC:/phpstudy_pro/WWW/dev.anqicms.com/Make sure all files are located in the root directory, notpublicin subdirectories, becauseanqicms.exeit needs to bepublic/templatewith the same level as
Modify localhostsFile
Due to the use of a custom domain name (such asdev.anqicms.com), the web browser defaults to not recognizing the corresponding IP address. Therefore, you need to modify the Windows system'shostsFile, manually map the domain to the local loopback address127.0.0.1.
Please start Notepad or another text editor as an administrator.hostsFiles are usually locatedC:\Windows\System32\drivers\etc\Open in the directory.hostsAfter the file, add a new line at the end of the file:
127.0.0.1 dev.anqicms.com
If you have configured multiple local domains, please add the corresponding records for each domain. After saving the file, refresh your DNS cache (you can run it in the command prompt)ipconfig /flushdnsMake the custom domain take effect on your local system immediately.
Start the AnQiCMS service and initialize the installation
After everything is ready, you can start the AnQiCMS service. Go to the root directory of the website where you deployed the AnQiCMS files, find and double-click to runanqicms.exeAn executable file. AnQiCMS is developed in Go language, and it usually runs silently in the background, so you won't see a separate program window pop up, which is normal.
After the service starts successfully, open your web browser, enter the local domain name you have configured in the address bar (for example, `http