The php 40001 error occurs because the access_token has expired or is not the latest, resulting in an error when sending the template message. The solution is to modify the access_token again.
#The operating environment of this article: Windows 7 system, PHP version 7.4, Dell G3 computer.
How to solve the php 40001 error problem?
PHP sends WeChat template message and reports 40001 invalid credential, access_token is invalid or not latest rid
Error reporting scenario:
Suddenly sent when using WeChat template message normally It failed. I checked the error report and found that 40001 invalid credential, access_token is invalid or not latest rid
According to the error message, I understood that the access_token was expired or not the latest.
According to this error message, it is found that the access_token is obtained separately by scanning the QR code and following the public account in the system. As a result, the access_token stored in the database is not the latest, resulting in an error when sending the template message.
The above are all personal records in the project, for reference only if necessary
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of How to solve the php 40001 error problem. For more information, please follow other related articles on the PHP Chinese website!