Uniform Server PHP IDE: PHP CLI
Uniform Server PHP IDE : Introduction | XDebug Overview | IDE Overview | PHP CLI | XDebug WinBinder
|
|
Uniform Server PHP IDE. |
PHP CLI
Uniform Server PHP IDE allows you to quickly test PHP CLI scripts. Having an integrated console window the environment is self-contained making it ideal for learning PHP CLI. Debugging CLI scripts requires only a few mouse scripts. Example on this page uses a very basic CLI script to demonstrate CLI input and output.
The step-by-step guide details all steps required for debugging.
Test Script
Test script input_output.php is located in folder H:\us_ide_1\us_portable_php_ide\php_scripts
Debugging steps
Open script, debug and console window
|
Start a debugging session
Note: If alerted by your firewall “e.g. CLI is trying to access the Internet” always allow access.
|
Request user input
Note 1: Debug buttons disabled control is passed to console window. This window is waiting for user input. Note 2: Variable $name remains undefined.
Note 3: Function fwrite() has written string "Enter some text:\n" to standard output STDOUT
|
Get user input
|
Write to console
|
Write to console alternative
Line 5 was included to show print can be used as an alternative to the fwrite(STDOUT, "") function |
Final step
|
Summary
Words and images can only provide a starting point hence fire-up the IDE and give it a workout.
The above has shown how to debug CLI scripts that use standard I/O.
Our IDE is capable of debugging PHP scripts that interface to the Windows API for example written using the WinBinder module.
Next page looks techniques for debugging a WinBinder application.