mkdir -p /tmp/xdebug[xDebug]zend_extension=\"大众/usr/lib/php/20151012/xdebug.so\公众xdebug.remote_enable = 1xdebug.remote_autostart=on; 以下部分为调优的配置xdebug.profiler_enable = 1xdebug.profiler_enable_trigger = 1xdebug.profiler_output_dir = \"大众/tmp/xdebug\"大众安装剖析工具kcachegrind
sudo apt install kcachegrind测试的源码文件
编辑inc.php
<?phpfunction SayHello(){ echo \"大众inc 中的sayhello|||\"大众;}?>
编辑index.php
<?phpinclude \"大众./inc.php\"大众; //引入模块echo \"大众hello world\"大众; SayHello(); //调用模块的函数?>启动做事
php -S 0.0.0.0:3000天生数据
浏览器中输入url

http://localhost:3000/index.php?XDEBUG_PROFILE剖析数据
运行kcachegrind;打开/tmp/xdebug中的文件
可以看到函数的实行韶光,调用次数,占用内存的情形
统计文件
可视化剖析界面