PHP Console allows you to handle PHP errors & exceptions, dump variables, execute PHP code remotely and many other things using Google Chrome extension PHP Console and PHP Console server library.
Note: PHP version 5.6.0 or above is required to use this plugin.
For support and pull requests, please refer to WP PHP Console GitHub repo and read the instructions there – thank you.
After you entered WP PHP Plugin password, your browser address bar should show a yellow “key” icon, which, if clicked, will prompt for the password you have set earlier.
The “key” icon will change into a “terminal” icon, click on it to open the PHP Console eval & options form.
The result includes the output, the return value and the net server execution time.
In your PHP code on the Server, you can call PHP Console debug statements like
First, install Google Chrome extension PHP Console from the Chrome WebStore.
Make sure the PHP Console Chrome extension is enabled through chrome://extensions/.
If the Google Chrome extension is not available on the Chrome Web Store, you can manually install it from source.
Then, add this plugin to your WordPress installation either by:
Installing it as any other WordPress plugin from your WordPress admin Plugins page (
Uploading it in
wp-php-consoledirectory into your
wp-content/plugins/directory or corresponding plugins directory in your installation
Activate the plugin through the
Pluginsadmin page in WordPress
Settingsmenu go to
WP PHP Console:
Enter a password for the Eval Terminal (this setting is needed or the terminal feature simply won’t work).
You can also set other options.
Allow only on SSL
Forces PHP Console to connect on a SSL connection only (of course then if you don’t actually have SSL (https), PHP Console simply won’t work).
Allowed IP Masks
You can secure your server by specifying IP addresses to restrict the accessibility from the Eval Terminal (a single address eg.
192.168.0.4 or an address mask eg.
192.168.*.* or multiple IPs, comma separated
192.168.1.22,192.168.1.24,192.168.3.*). In case of having issues connecting with the Remote PHP Eval Terminal, try leaving this blank.
Register PC Class
Tick this option to register
PC in the global PHP namespace. This allows to write
PC::debug($var, $tag) or
PC::magic_tag($var) instructions in PHP to inspect
Show Call Stack
Short Path Names
/server/path/to/document/root/WP/wp-admin/admin.php:38 will be displayed as
Is this an official plugin from PHP Console author?
No, but it makes use of Sergey’s PHP Console library as it is.
Does it work with Firefox, IE, Opera or other browsers?
No it doesn’t, unless PHP Console browser extension is ported, for example, as a Firefox add-on.
Can I use PHP Console in a live production environment?
You can but it is probably not a good idea. You should do your debugging and testing on a development/testing environment on a staging server or local machine. Likewise, you normally wouldn’t want to turn on PHP error reporting or set WP_DEBUG to true in a live site as you wouldn’t want to display error information to public. Furthermore, PHP Console allows execution of any remote PHP code through terminal – for this you can set a strong password and restrict the IP address range to access the terminal, but still it’s not advisable. Besides putting your site at risk, you will also add more load to your server.
Will there be items logged in my debug.log files when a PHP error occurs?
Generally no, WP PHP Console will intercept those. However, it’s always a good idea to keep an eye on the logs too. Furthermore, WP PHP Console is unable to catch many server errors that result in a 500 error code on the browser. For those you may have traces left in the debug.log file.
Why are PHP arrays shown as objects?
['key1' => 'var2', 'key2' => 'var2', ... ]are shown as objects; automatically indexed arrays like
[ 'var1', 'var2', ... ]are shown as arrays.
Fatal error: Class ‘PC’ not found in ‘my code’
PC::debug( $my_var, $my_tag ) can only be called after the WordPress core included the WP PHP Console plugin.
You could move your debug code or either do something like
Contributi e sviluppo
“WP PHP Console” è un software open source. Le persone che hanno contribuito allo sviluppo di questo plugin sono indicate di seguito.Collaboratori
“WP PHP Console” è stato tradotto in 1 lingua. Grazie ai traduttori per i loro contributi.
Traduci “WP PHP Console” nella tua lingua.
Ti interessa lo sviluppo?
Esplora il Codice segui il Repository SVN iscriviti al Log delle Modifiche. Puoi farlo tramite RSS con un lettore di feed.
Changelog (registro delle modifiche)
- Misc: Add note about Chrome extension unavailability in web store
- Misc: Add plugin admin action links
- Misc: Improved settings handler
- Misc: Updates PHP Console core library to v3.1.8
- Misc: Add plugin admin action links
- Misc: Improved settings handler
- Fix: Temporarily suppress PHP warnings while connecting with PhpConsole to avoid headers already sent warnings, then restore all errors reporting
- Misc: Improved PHP and WordPress compatibility loader
- Fix: Try to get rid of PHP errors related to “Unable to set PHP Console server cookie” and “Cannot modify header information – headers already sent”
- Misc: Require PHP 5.6
- Misc: Updates PHP Console core library to v3.1.7
- Misc: Bump WordPress compatibility to mark support for the latest versions
- Fix: Fixes “PHP Warning: session_start(): Cannot send session cache limiter – headers already sent” notice in logs
- Misc: Internal changes, new Settings class, deprecated methods and properties in main Plugin class
- Misc: Updated PHP Console Library to 3.1.6
- Misc: Tested up to WordPress 4.5.2
- Enhancement: Support for WordPress language packs
- Misc: Improved error and exception handling and usage of Composer in plugin development
- Misc: Updated PHP Console Library to 3.1.5
- Misc: Tested up to WordPress 4.4.1
- Misc: Use WP Requirements as Composer dependency.
- Misc: Internal changes (alternate PHP version check, automated SVN deploys)
- Fix: Fixes a bug
Cannot send session cache limiter - headers already sent
- Misc: Updated PHP Console Library to 3.1.4
- Misc: Made PHP 5.4.0 the minimum required version to activate the plugin
- Misc: Updated PHP Console library to 3.1.3
- Misc: Supports WordPress 4.2
- Fix: Fixes “Fatal error: Using $this when not in object context” upon activation in some installations.
- Enhancement: earlier PC initialisation – props @Polfo
- Misc: Updated readme files
- Fix: IP mask
- Enhancement: added configuration options – props @Polfo
- Register PC class
- Show Call Stack
- Short Path Names
- Fix: Fixes “Wrong PHP Console eval request signature” error when executing WordPress code from terminal, props @Polfo @barbushin
- Fix: Bugfixes
- Misc: Submission to WordPress.org plugins repository.
- Fix: Fixed allowed IPs bug.
- Misc: Updated dependencies and got rid of git submodules.
- Fix: PHP Console server is now instantiated later, allowing to catch all your theme functions too.
- Misc: Included PHP Console server library as git submodule rather than a composer dependency.
- Primo rilascio pubblico.