Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 PHP 脚本卡住了,但我不知道代码在哪里。
我正在使用 Xdebug。
如何找出服务器当前卡在代码的哪一行?
卡住?如果您的意思是花费最多时间的行,那么您可以设置 xdebug 以生成跟踪转储并使用kcachegrind或webgrind分析它们
如果你把它放到你的 php.ini 中:
[xdebug] xdebug.profiler_enable_trigger = 1
?XDEBUG_PROFILE您可以通过添加到您的网址来生成转储。保存转储的默认目录是 /tmp/
?XDEBUG_PROFILE
跟踪执行或使用分析器。