Use XDebug debugging and unit test coverage rate analysis. Today, I will share some of my experiences with XDebug. XDebug is installed only when it is used to generate a Coverage Analysis file. Recently, I used it myself today. XDebug To share some of your experiences. XDebug This is also because it is installed only when it is used to generate a Coverage Analysis file. it is not frequently used in recent contacts, but it is indeed a good tool, if you want to rely on it to analyze program performance, you still need to try it yourself. How nice it is, please let me know one by one.
I, Installation(XDebugAndPHPUnit)
A: InstallationXDebug:
XdebugDownload from the internetXdebug DllFile, stored inPhpLoadedExtDirectory (you can choose to rename, suchPhp_xdebug.dll,Then openPhp. iniFile, add configuration
[Xdebug]
Zend_extension_ts = php_xdebug.dll
Xdebug. profiler_enable = on
Xdebug. trace_output_dir = D: \ PHPAPP \ XDebug
Xdebug. profiler_output_dir = D: \ PHPAPP \ XDebug
XdebugUseZendThereforeZend_extension_tsOrZend_extension, TsYesThread_safety,Currently5.3Only supportedZend_extensionLoad,<5.3UseZend_extension_tsLoad (or you can viewPhpinfoEnabled or notZts), And then restartApache,ViewPhpinfo,You will findXDebugOption.
We can see thatXdebug. profiler_enable,Xdebug. profiler_output_dir,Xdebug. trace_output_dirThe three items are just configured. you can install your own items and configure the remaining items,Xdebug. profiler_enable: Enable performance analysis,
After this feature is enabledXdebug. profiler_output_dirGenerated under this directoryCachegrind. out. XXXIf you specifyXdebug. profiler_output_nameThe output file will be the specified name.. Xxx(This method is not suitable for analysis, the reason will be explained later ),
Xdebug. trace_options: This is to enable tracking,
After this option is enabledXdebug. trace_output_dirProduction tracking file,Note that this option will affect the running speed because it needs to record a series of events in the tracking process.
AboutXDebugNote the following:XDebugYes, that is, the configurationXDebugThe program is runningDebugStatus, so this timeZend_optimizerIt cannot be used, and the program cannot be debugged or optimized.