How to debug WeChat development locally

Source: Internet
Author: User
This article mainly introduces how to debug ngrok locally: ngrok is based on windows
1: Why ngrok?
During development, you must enter the url connected to the server. this url must be an Internet domain name,
That is to say, we need to develop on the ip server corresponding to this internet domain name, but there is no way to develop and debug it locally.
Therefore, the ngrok is used to obtain an Internet domain name. The Internet domain name actually accesses the local host.
In this way, you can enter the Internet domain name in the required Internet url and debug it locally.
2: Download ngrok-secure introspectable tunnels to localhost for windows
3: The custom domain name after your auth token is obtained after ngrok registration. this token must be available.
4: open cmd cdto ngrok.exe in the directory, execute ngrok 80 will be able to give your local 127.0.0.1: 80 assigned a domain name that can be accessed by the Internet such as http://1f1b1c.ngrok.com
That is, the Internet access http://1f1b1c.ngrok.com is to access your local 127.0.0.1: 80, of course, if you execute ngrok 8080, it is to assign a domain name to access 127.0.0.1: 8080
5: The domain name allocated above is temporary. the domain name may change next time you open the computer. we need a fixed domain name mapped to port 80 of the local machine.
Therefore, log on and execute ngrok-authtoken XUsFLvG4hgb8ukjvML8YBXX 80. here, you fill in the token you provided during registration,
Then ngrok-subdomain myapp 80 so that you can continue to access the local 127.0.0.1: 80 through the http://myapp.ngrok.com
Of course, if you want to access port 8080, change all the above 80 to 8080.
6: Do not close the cmd window. if you want to view the ngrok's intermediate http information, access http: // localhost: 4040/
7: for specific development, it is important to note that the ngrok is used as a transit because the default statement libxml_disable_entity_loader (true) cannot be used for security reasons );
So comment out the comment and cancel the comment after it is officially deployed to the server.

For more articles about how to debug locally in development, refer to PHP Chinese network!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.