It's hard for me to get xdebug profiling to work and integrate into PhpStorm 2017. I tried to follow this video without success.
I know that xdebug is installed correctly on the web server (local installation of Apache for Windows) and is correctly integrated into PhpStorm, because when I click "Start listening for PHP debugging connections" in the IDE, my breakpoints stop the code execution, and I can debugging is just fine. I just can't get the profiler to generate my files, and I don't even know if it works.
php.ini
[xdebug]
zend_extension="php_xdebug-2.5.5-5.6-vc11.dll"
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_autostart=1
; xdebug.profiler_enable=1 ; I've tried uncommenting. Made no difference
; xdebug.profiler_enable_trigger=1 ; I've tried uncommenting. Made no difference
xdebug.profiler_output_dir="C:\websites\tmp"
xdebug.profiler_output_name="cachegrind.out.%p"
xdebug.idekey=PHPSTORM
At the beginning of my PHP execution, I tried to enable profiling as follows:
ini_set('xdebug.profiler_enable','1');
I also tried to run the script from the command line with the following:
PHP .php -d xdebug.profiler_enable=1
. C:\websites\tmp .
Xdebug, , ( , ).
- PHP 5.6
- Apache 2.4
- xdebug 2.5.5
- PhpStorm 2017
- Windows 7 64bit
Update
xdebug.remote_log ini , Apache. , ( , " PHP-" PhpStorm):
Log opened at 2017-07-22 20:33:03
I: Connecting to configured address/port: localhost:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug"
fileuri="file:///C:/path/to/script.php"...>
</init>
, . , , PHP .php -d xdebug.profiler_enable=1 script ini_set('xdebug.profiler_enable','1'), , xdebug
Log opened at 2017-07-22 20:38:10
I: Connecting to configured address/port: localhost:9000.
E: Time-out connecting to client. :-(
Log closed at 2017-07-22 20:38:11
2
cachegrind.out! , , , , xdebug.profiler_enable my php.ini Apache. - , , . php.ini ,