PHP在curl_exec时使用xdebug卡主,报错Internal Server Error

(时间着急想要看解决方案的直接查看【解决方案】)

问题描述:在一次跨域请求时,当xdebug断点打在curl_exec上,点击下一步后一直卡主,然后等待42秒报错Internal Server Error。

详细报错信息:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.

找错过程:

首先我在百度输入关键词‘Internal Server Error’,结果百度都是说是.htaccess文件的错误,各种方法试了一个遍,都没用。

其次我怀疑是不是php.ini中curl没打开,打印phpinfo发现并没有问题。

使用curl_error,没有报错信息。

解决曙光:

解决问题的思路是从让同事帮忙调错的时候开始的。

他有一个习惯,他不喜欢用xdebug,所以每次调错都会把xdebug的小话筒关掉,然后问题就神奇的解决了。但是当我把小话筒打开,甚至我连断点都没有打的情况下执行curl_exec程序仍然会卡在这里。此时我就觉得,这里curl_exec执行不了极大可能和xdebug有关系,所以一组关键词浮现在我的脑海。。。,对就是‘xdebug curl_exec’,在谷歌里输入关键词,找到解决方案:https://stackoverflow.com/questions/32212672/xdebug-session-in-phpstorm-stuck-on-curl-exec-call/32212674

这里感谢谷歌,帮我解决了问题。

解决方案:

phpstorm->file->settings->languages & framewords ->php->debug->external connnections ,

将Max.simultaneous connections 改为2,完美!

发布了10 篇原创文章 · 获赞 5 · 访问量 7375

猜你喜欢

转载自blog.csdn.net/qq_41566366/article/details/103868402