Remote debugging PHP from phpStorm
Despite all the documentation out there, it seemed to take me longer than it should. Although in hindsight, it could have been working originally as phpStorm's indicator that it's debugging is subtle.
To setup follow do the following:
/home/[username]/public_html/.user.ini
See Analyzing Xdebug Profiling Data for more information.
Debug session within phpStorm
Two articles to get you started:To setup follow do the following:
- For chrome (probably the easiest), install this plugin: Chrome Plugin
- Configure the plugin and select phpStorm as your IDE.
- Next sign onto your remote server and enable xdebug module
- for cPanel, click select php version (only 5.4 and 5.5 supported)
- update version
- check the xdebug module
- click update
- Edit the php.ini, e.g. for cPanel, edit or create: /home/[username]/public_html/.user.ini
; Settings for xdebug module was already loaded on this machine: ; zend_extension=/opt/alt/php54/usr/lib64/php/modules/xdebug.so xdebug.remote_host=[your modems IP address] xdebug.remote_port=[a port forwarded through your modem to firewall, e.g. 9800] xdebug.remote_enable=1
- Setup phpStorm's port:
Settings->Languages & Frameworks-->PHP-->Debug Xdebug port = [remote_port] set above - Setup phpStorm remote debug settings:
- Run --> Edit configurations
- Add --> PHP Remote Debug
- Give it a name
- Ide key: "PhpStorm"
- Servers (select or add via the "...")
- Host: your remote server host
- Port: http port usually 80
- Debugger: xdebug
- Check "use path mappings"
- Setup any mappings
- Click validate
- Click close
- Click ok
- Run --> Start listening for PHP Debug Connections
- In the browser, click the debug icon in the address bar and select debug
- visit your sites URL
You may need to go to the site first, the select debug, then refresh the page.
Note: .user.ini is cached by apache, so it may not work instantly.
When it works the page won't seem to load and in phpStorm the debugger tab should show a clickable green arrow ("Resume Program Execution") and it should show the current frame & variables.
I went through a couple of settings to get here so I may have missed a little tweak along the way.
Profiler
These settings were taken from: Diagnosing slow PHP execution with Xdebug and KCachegrind./home/[username]/public_html/.user.ini
; Settings for xdebug ; module was already loaded: ; zend_extension=/opt/alt/php54/usr/lib64/php/modules/xdebug.so xdebug.profiler_output_dir=/home/[username]/php xdebug.profiler_append=On xdebug.profiler_enable_trigger=On xdebug.profiler_output_name="%R-%u.trace" xdebug.trace_options=1 xdebug.collect_params=4 xdebug.collect_return=1 xdebug.collect_vars=0 xdebug.profiler_enable=0The relevant .trace file can be downloaded and loaded into phpStorm via: Tools->Analyse Xdebug Profiler Snapshot.
See Analyzing Xdebug Profiling Data for more information.
PhpStorm gives rich and keen govern manager
ReplyDeletecode, run unit-tests or offer to investigate that is aesthetic. PhpStorm gives rich and keen govern manager for PHP with grammar highlighting, broadened code arranging setup, on-the-fly blunder checking, and control culmination that is shrewd. PhpStorm 2017, discharged on March 23rd, 2017, is only a fresh out of the plastic new
ReplyDeleteI like to use and recommend Codelobster for it
ReplyDeleteIt’s necessary to notice the difference between accessing a geo-blocked however authorized site and a banned site or one that facilitates illegal playing exercise. For example, we implore you to not use a VPN to entry playing websites in nations such as the UAE the place playing is illegal the law|is unlawful} and could land you severe trouble|in deep trouble} with the authorities. The goal of this examine was to handle latest calls to disentangle problematic versus non-problematic intensive involvement in cell playing . While not the be-all and end-all of a great on line casino, offering great welcome bonuses and rewards does go a 카지노 사이트 great distance in serving to new players decide to hitch a casino’s ranks. Bonuses and rewards are an internet casino’s way of incentivizing its players and constructing customer loyalty.
ReplyDelete