As a website operator who is deeply familiar with 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 a high-efficiency local development environment for AnQiCMS under Windows, which allows you to freely create, edit, publish, and optimize content, as well as carry out various function tests, thereby greatly improving work efficiency.

The following will elaborate on how to carry out local development and testing of AnQiCMS in the Windows environment.

Under Windows environment, local development and testing of AnQiCMS: Detailed Guide

Preparation Work

Before you start setting up your local development and testing environment, there are several necessary preparations that need to be completed.Firstly, you need to download the latest Windows version package from the AnQiCMS official website.Choosing a stable version compatible with your Windows system is the foundation to ensure the smooth progress of subsequent steps.

Moreover, a fully-featured 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 the website.

Configure 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 its official instructions.

First, create a new local website in PHPStudy.Open the PHPStudy control panel, navigate to the "Websitedev.anqicms.com。PHPStudy will be in the website root directory you set (usuallyC:/phpstudy_pro/WWW/)An automatically generated folder corresponding to the domain name is created below. Please remember the complete path of the root directory of this website.

AnQiCMS's web service usually starts from the project'spublicThe subdirectory provides static resources. Therefore, in your newly created website configuration, you need to set the 'Run Directory' or 'Site Root Directory' of PHPStudy to point 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 that the configuration takes effect.

Deploy the core files of AnQiCMS

After you complete the configuration of your local website, the next step is to deploy the AnQiCMS program files to the correct directory. Please copy all the files (including theanqicms.exeExecutable files,templateFolder,publicFolder and other related files) Copy and paste them into the root directory of the website you created in PHPStudy, for example,C:/phpstudy_pro/WWW/dev.anqicms.com/Ensure all files are located within this root directory, notpublicin a subdirectory, becauseanqicms.exeit needs to be level withpublic/templateand other folders.

Modify the localhostsFile

Since you are using a custom domain name (such asdev.anqicms.com),the web browser cannot identify its corresponding IP address by default. Therefore, you need to modify the Windows system'shostsFile, map this domain manually to the local loopback address.127.0.0.1.

Please start 'Notepad' or another text editor as an administrator.hostsFiles are usually located inC:\Windows\System32\drivers\etc\directory. OpenhostsAfter the file, add a new record 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 this in the command prompt)ipconfig /flushdns),Make the custom domain take effect immediately on your local system.

Start AnQiCMS service and initialize the installation

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. You will not see an independent program window pop up, which is a normal phenomenon.

Service started successfully, open your web browser, enter the local domain name you configured in the address bar (for example, `http