search
Homephp教程php手册PHPStorm解决Xdebug Slow问题

今天白天才架起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.


文章地址:

转载随意^^请带上本文地址!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment