Показаны сообщения с ярлыком xdebug. Показать все сообщения
Показаны сообщения с ярлыком xdebug. Показать все сообщения

среда, 15 мая 2013 г.

Configure PhpStorm for debugging

Params:
IDE: PhpStorm6
OS: Ubuntu 12.10

Problem: 
Configure IDE for debugging.

Solution:
1) At first install and configure XDebug.


 My additional xdebug.ini options:
  • xdebug.remote_enable=On
  • xdebug.remote_host=localhost
  • xdebug.remote_port=9000
  • xdebug.max_nesting_level=250

Do not forget restart your web server with new configuration.
Also you can check if XDebug is used in phpinfo output.

2) Install and configure "Xdebug Helper" plugin in browser(chrome for example)
I using https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc
Configuration options for it:
IDE key Other:PHPSTORM1
Or you can try another key from PhpStorm documentation page:
http://www.jetbrains.com/phpstorm/marklets/

3) Configure PhpStorm:
Add your app server: File -> Settings -> PHP -> Servers (Debugger: Xdebug)
Configure debug options: File->Settings->PHP->Debug
  Xdebug | debug port - 9000
  Xdebug | Can accept external connections - checked


Debuging
Run->Break at first line in PHP scripts - check it
Run->Start Listen PHP Debug Connections - enable listener
Go to debugging page in browser.
Click on gray bug icon and enable Debug.
After these actions all should be ready, so reload page(or send a form, or click on link, ...) and debug will start.

Thanks to authors from these resources:
http://icephoenix.us/php/how-to-setup-local-php-debugging-with-phpstorm-and-xdebug/
http://blog.jetbrains.com/webide/2011/02/zero-configuration-debugging-with-xdebug-and-phpstorm-2-0/
http://blog.jetbrains.com/webide/2011/03/configure-php-debugging-in-phpstorm-2-0/

четверг, 17 марта 2011 г.

Configure xDebug with Zend Studio or Eclipse IDE

system: gentoo | php: 5.3.3 | xdebug: 2.0.5

1. Install xdebug: emerge dev-php/xdebug-client -av
2. Edit php.ini: Include xdebug configuration file in php.ini.
    • create and put xdebug.ini file in directory: /etc/php/apache2-php5/ext/
    • create soft link: ln -s /etc/php/apache2-php5/ext/xdebug.ini /etc/php/apache2-php5/ext-active/
    •  xdebug.ini file content:  
    [xdebug]
    zend_extension=/usr/lib/php5/lib/extensions/no-debug-zts-20090626/xdebug.so
    xdebug.auto_trace="0"
    xdebug.trace_output_dir="/tmp"
    xdebug.trace_output_name="trace.%c"
    xdebug.trace_format="0"
    xdebug.trace_options="0"
    xdebug.collect_includes="1"
    xdebug.collect_params="0"
    xdebug.collect_return="0"
    xdebug.collect_vars="0"
    xdebug.default_enable="0"
    xdebug.extended_info="1"
    xdebug.manual_url="http://www.php.net"
    xdebug.max_nesting_level="100"
    xdebug.show_exception_trace="0"
    xdebug.show_local_vars="0"
    xdebug.show_mem_delta="0"
    xdebug.dump.COOKIE="NULL"
    xdebug.dump.ENV="NULL"
    xdebug.dump.FILES="NULL"
    xdebug.dump.GET="NULL"
    xdebug.dump.POST="NULL"
    xdebug.dump.REQUEST="NULL"
    xdebug.dump.SERVER="NULL"
    xdebug.dump.SESSION="NULL"
    xdebug.dump_globals="1"
    xdebug.dump_once="1"
    xdebug.dump_undefined="0"
    xdebug.profiler_enable="0"
    xdebug.profiler_output_dir="/tmp"
    xdebug.profiler_output_name="cachegrind.out.%p"
    xdebug.profiler_enable_trigger="0"
    xdebug.profiler_append="0"
    xdebug.profiler_aggregate="0"
    ;xdebug.remote_enable="0"
    xdebug.remote_enable=On
    xdebug.remote_handler="dbgp"
    xdebug.remote_host="localhost"
    xdebug.remote_mode="req"
    ;xdebug.remote_port="9000"
    xdebug.remote_port=9000
    xdebug.remote_autostart="0"
    ;xdebug.remote_log=""
    xdebug.remote_log="/var/www/xdebug.log"
    xdebug.idekey=""
    xdebug.var_display_max_data="512"
    xdebug.var_display_max_depth="2"
    xdebug.var_display_max_children="128"
    3. Check  phpinfo(). If all OK, you will see  "xdebug section"
    4. Configure Zend Studio.
    • Open your project in Zend Studio
    • In the main menu select Project->Properties
    • On the left side of the window select "PHP Debug" and then click on "Configure Workspace Settings"
    • On the "PHP Debugger" dropdown select Xdebug and click "Apply"
    • Click "Configure" to the right of Xdebug in the same window.
    • Select Xdebug and click "Configure".
    • On the "Accept remote session(JIT)" select "any" and click "OK". This is extremely important and this is where most people get stuck.
    5. Debug!!! :)

    very helpfull for me!