Recently, when using the WeChat QR code scanning payment function of a mall, when the code builds a WeChat order and then requests WeChat through curl, the curl_exec function reports a 500 error, and no detailed error message is given. There were no problems when using the Alibaba Cloud server and my local test before. Because the customer needs to put the program on the Alibaba Cloud virtual host, this problem occurs. And I confirmed that curl is turned on and can be used. The error displays display_errors and error_reporting has also been set up to display all errors. But: 1. Only 500 errors are displayed and no detailed error information is displayed. 2. The host can only see access logs, cannot see error logs, and cannot see and modify php.ini settings and apache settings. 3. This error cannot be skipped by using @ and try catch, and the resource parameters of curl are also correct (I have printed each parameter)
Until I report to Alibaba Cloud After submitting a work order, he reminded me that the curl of Alibaba Cloud virtual host does not support the https protocol! Oh, the curl address to WeChat is https protocol. It looks like I need to change the server. Also, the issue of not displaying detailed errors has yet to be resolved. . .
The above has introduced that Alibaba Cloud virtual host reports a 500 error when executing curl_exec, and there is no detailed information. It includes the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.