


Mini program learning record: Solution to the problem of Could not resolve-api.weixin.qq.com in Linux
I have been trying to learn how to install and use mini programs in the past few days. Personally, I feel that it will be better if you follow the mini program documentation to understand and learn before developing!
Mini program development document address link:
https://developers.weixin.qq.com/miniprogram/dev/framework/
However, when I was feeling very proud, I was poured cold water on me when I tried to learn how to install it for the first time. When the program was running normally, a problem appeared as shown below:
As shown in the picture above, the problem "Could not resolve: api.weixin.qq.com (Could not contact DNS servers)" occurred.
According to the mini program development documentation, no other situation will occur when following this module normally, so I was a little confused when I first saw this error message. My first reaction was The domain name "api.weixin.qq.com" reported in the error belongs to WeChat. If the error was reported, there should be a problem with WeChat. Then I immediately called the relevant WeChat customer service number to inquire. It turned out that it was not a problem with WeChat.
What’s the problem? Is it a problem on the server? So I tried to ping this domain name to see if the ping was successful. After testing the command, I found that data communication was not possible, but I didn’t know how to correct an error like this where the ping failed.
So I started to conduct corresponding search queries on Baidu, and found that there was no better way to solve this problem. Finally, I consulted a friend. After sorting out my friend's ideas, I This problem was finally solved. "A good memory is not as good as a bad writing." Development requires learning to learn, but also learning to record. So I will make a simple record this time and share with you the experience of this project.
1. First of all, we troubleshoot the problem based on the problem. Since the backend uses curl to connect, we must first ensure that our curl connection is normal and needs to be tested. Check whether curl can parse dns normally. Use the following command to test:
curl api.weixing.qq.com
The final test result is that ping fails! Then we started to implement corresponding new solutions.
2. The ping failure is generally a problem related to DNS configuration, so we started to edit and modify the DNS configuration file:
vi /etc/resolv.conf
Based on the content of the source file Next, add the following two lines of data code:
nameserver 114.114.114.114 nameserver 8.8.8.8
Because the PHP environment I am in is Linux and I am operating a pagoda, I use xshell to modify the data in the command line interface. After saving, retest curl and the problem is solved.
Every development problem will give us a new warning, allowing us to find ways to solve the problem while finding it, but don’t forget, after solving the problem, we must learn to record the process of the problem , learn to share it with everyone, let's work together and swim in the ocean of knowledge of PHP development!
The above is the solution to the problem of Could not resolve-api.weixin.qq.com in Linux during small program development. For more information, please pay attention to other related articles on the PHP Chinese website!
The above is the detailed content of Mini program learning record: Solution to the problem of Could not resolve-api.weixin.qq.com in Linux. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

ArtGPT
AI image generator for creative art from text prompts.

Stock Market GPT
AI powered investment research for smarter decisions

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Yesterday, I introduced the installation method of VMwareWorkstationPro, but due to the limitation of recording time, I will bring you updates today! ! ! Friends who like to try new things are welcome to install the Ubuntu system below. Ubuntu is also a very excellent operating system. Although it is not as intuitive and easy to use as Windows, for example, many applications need to be downloaded through the command line, which may be difficult for novices, but you can try it. The following are some websites to download system images: Windows operating system images, tools and resources: https://msdn.itellyou.cn/Linux operating system official website

No,macOSisnotbasedonLinux;itisbuiltonUnix,specificallytheUnix-likeDarwinoperatingsystemderivedfromBSDandNeXTSTEP.1)macOSiscertifiedUnix-compliantsinceversion10.5andusestheDarwincorewiththeXNUkernel,whichcombinesMach,BSD,andI/OKitcomponents.2)Itdoesno

To make Linux processes run in real-time FIFO scheduling, you need to use the chrt command or sched_setscheduler system call to set the scheduling policy and priority, such as sudochrt-f99./app or configure SCHED_FIFO and priority parameters in the C program, and ensure that the process has CAP_SYS_NICE capability or root permissions, and configure rtprio and memlock restrictions through limits.conf to ensure real-timeness and avoid priority reversal. You need to use a mutex that supports priority inheritance.

Create user with adduser or useradd, 2. Modify user with usermod, 3. Delete user with deluser or userdel, 4. Create group with groupadd, 5. Add user to group with usermod-aG, 6. Remove user with gpasswd-d from group, 7. Delete group with groupdel, 8. View information with whoami, groups, getent and other commands, 9. Follow best practices such as avoiding direct use of root, regularly cleaning accounts, setting password policies, and reasonably allocating group permissions. By mastering these core commands and selecting appropriate tools according to the distribution, the management of Linux users and groups can be effectively realized.

The official download portal of Aisi Assistant is located on the official website https://www.i4.cn/, and provides computer and mobile downloads, supporting device management, application installation, mode switching, screen projection and file management functions.

Common methods for installing .deb packages include: using the dpkg command to install and use apt to repair dependencies; 2. It is recommended to use aptinstall./package_name.deb to automatically handle dependencies; 3. You can double-click the file to install through the software center in a graphical way; 4. After installation, you can use dpkg-l or dpkg-s to check the package status.

Uselshw,inxi,andspecificcommandslikelscpuorlspcitoretrievedetailedhardwareinformation;lshwprovidescomprehensivesystemdata,inxioffersuser-friendlysummaries,anddedicatedtoolstargetspecificcomponentsefficiently.

ToinstallVSCodeonLinux,usetheofficialAPTrepositoryforautomaticupdates,Snapforcross-distributioncompatibility,oramanualtarballforfullcontrol.Choosebasedonyoursystemandneeds.
