今天白天才架起PHPStorm+xdebug的调试环境,就遇到了各式各样的问题:A,访问超慢响应、B,访问超快响应但是是空白页。
问题A解决的方法很多,总归还有解决办法;问题B我估计是线程问题,也许可以通过调试php.ini的配置搞定,也许不是,很难讲清楚,线程的问题可能要跟xdebug的版本扯上关系。
解决方式:PHP.ini 找到memory_limit参数,增大,换一个浏览器,我之前一直用Google Chrome调试程序,之后就开始变慢下来,直到每个页面变成6秒才加载完毕,已经忍无可忍。换成了Firefox、IE均没有这个问题(这个方法很好用,还能立刻见效!)使用 xdebug.profiler_enable_trigger配置,有选择的运行xdebug功能探查程序。
xdebug.remote_host 的值最好跟你服务器的IP一致,比方说你是通过localhost访问,则这里写localhost,你是127.0.0.1访问,就写127.0.0.1
看看你的xdebug.profiler_output_dir目录是否已经达到几G了?(一套电商程序很可能在持续开发十几个小时后,xdebug.profiler_output_dir目录的xdebug文件达到好几G!)
平时不需要的时候,最好关闭xdebug!
xdebug.remote_enable = 0 xdebug.profiler_enable = 0 xdebug.remote_autostart = false
最后,一句话:DON'T RUN XDEBUG ON PRODUCTION.
文章地址:
转载随意^^请带上本文地址!

Hot AI Tools

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

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

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

WebStorm Mac version
Useful JavaScript development tools
