dbalabka / phpdebug-cli
XDebug and Zend Debugger PHP CLI debugging helper console command with PhpStorm, NetBeans support
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 10
Watchers: 2
Forks: 1
Open Issues: 3
Language:Shell
Suggests
- ext-xdebug: You require X-Debug extension to perform CLI scrips debugging.
This package is auto-updated.
Last update: 2024-11-07 19:03:39 UTC
README
XDebug PHP CLI debugging helper console command with PhpStorm, NetBeans support
Installation steps
- Donwload file into ~/.phpdebug. Run following command:
curl https://raw.githubusercontent.com/torinaki/phpdebug-cli/master/phpdebug.sh > ~/.phpdebug
- Put following lines into ~/.bashrc :
# Get the aliases and functions if [ -f ~/.phpdebug ]; then . ~/.phpdebug fi
- (optional) Script will try to autodetect your machine IP where runs IDE or use 127.0.0.1 otherwise.
If automatic detection doesn't work for you, set ip directly via IDE_IP enviroment variable:
export IDE_IP=1.2.3.4
- (optional) Change ports if it not same as default (see local variables zend_debugger_config and xdebug_config);
export IDE_ZEND_PORT=10137 export IDE_ZDEBUG_PORT=9000
- (optional) Change IDE specific configuration: serverName, idekey
export IDE_SERVERNAME="Any_server_name" export IDE_KEY="PHPSTORM"
- Run use it immediately or just restart terminal:
source ~/.bashrc
Usage
- After installation use phpdebug/phpdebugoff commands to start/stop debugging:
$ phpdebug $ php ./script1_to_debug.php $ php ./script2_to_debug.php $ phpdebugoff
- Or simply use instead of php command to debug only one script
$ phpdebug -dmemory_limit=1G ./script_to_debug.php
Configuration options
You can use evniroment variables to change default configurations
export IDE_ZEND_PORT=10137 export IDE_XDEBUG_PORT=9000 export IDE_KEY="PHPSTORM" export IDE_SERVERNAME="$(hostname)" # SSH client IP will be autodetected by default export IDE_IP="1.2.3.4"