Requirements
Firstly, you need to insall XAMPP, and Eclipse (or and IDE with PDT support)
Configure PHP to Load Xdebug
Add these lines to your php.ini file (at c:\xampp\php\php.ini
or somewhere else depending on your platform):
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
xdebug.remote_enable = 1
Verify XDebug
Create a page called test.php in your web root folder, and add a call to the phpinfo() function:
<?php phpinfo(); ?>
Configure PHP Debug in Eclipse
- Create a new project using the location of the current WordPress location.
- Click the Debug drop down arrow and select Debug Configurations.
- Enter the following information as shown in the picture:
Name—Type a name for the server.
Debugger—Select XDebug.
Base URL—Type the URL for your local domain test.
Local Web Root—Set the path of your web root.
Test the Debugger
Add the following code to the function.php fine in the active theme of the WordPress installation. Then add a breakpoint and run the debug button.
add_filter( 'the_content', 'my_filter_content_func' );
function my_filter_content_func( $content ) {
$words_replace = array('wordpress');
$content = str_ireplace( $words_replace, 'MyBlog', $content );
return $content;
}
Reference:
https://www.genuitec.com/debugging-php-with-eclipse-pdt/ https://eclipse.org/pdt/articles/debugger/os-php-eclipse-pdt-debug-pdf.pdf
I just want to say that your page helps me a lot and it solves my problem. Thank you for sharing.