VaderDark Posted December 4, 2023 Share Posted December 4, 2023 Here is my php.ini: zend_extension=xdebug.so xdebug.remote_enable=1 xdebug.remote_host=localhost xdebug.remote_port=9000 xdebug.log=/home/vader/Downloads/xdebug.log xdebug.idekey=sublime xdebug.remote_connect_back = Off xdebug.client_host=somesite.local In hosts: 127.0.0.1 somesite.local In httpd-hosts: <VirtualHost *:80> ServerName somesite.local DocumentRoot /home/vader/public_html/someclient/somesite/drupal/web/ </VirtualHost> My phpinfo() says this: xdebug.client_discovery_header HTTP_X_FORWARDED_FOR,REMOTE_ADDR HTTP_X_FORWARDED_FOR,REMOTE_ADDR xdebug.client_host somesite.local somesite.local xdebug.client_port 9003 9003 xdebug.idekey sublime sublime xdebug.log /home/vader/Downloads/xdebug.log /home/vader/Downloads/xdebug.log xdebug.log_level 7 7 xdebug.max_nesting_level 256 256 xdebug.max_stack_frames -1 -1 xdebug.mode develop develop xdebug.output_dir /tmp /tmp My Xdebug helper extension for Firefox says: IDE key = sublime and the icon is green (enabled). My Xdebug settings in Sublime text are: { // "path_mapping": { // "/home/vader/public_html/someclient/somesite/drupal/web/": "/home/vader/public_html/someclient/somesite/drupal/web" // }, "ide_key": "sublime", // "port": 9003, // Update this line /// "remote_enable": true, // "remote_host": "somesite.local", // "remote_port": 9003, // Update this line "client_host": "somesite.local", "client_port": 9003, // Update this line } including my other attempts. I create a breakpoint in Submlime and Start Debugging and load a page, and nothing happens. If I put a "echo 1;die;" just before the breakpoint, that works, meaning I know it's executing that code. What am I doing wrong? Quote Link to comment https://forums.phpfreaks.com/topic/317506-trouble-with-xdebug-breakpoint-using-sublime-text/ Share on other sites More sharing options...
requinix Posted December 4, 2023 Share Posted December 4, 2023 What breakpoint? What code? Quote Link to comment https://forums.phpfreaks.com/topic/317506-trouble-with-xdebug-breakpoint-using-sublime-text/#findComment-1613298 Share on other sites More sharing options...
VaderDark Posted December 5, 2023 Author Share Posted December 5, 2023 I actually want to debug a custom Drupal 9 module, but to test Xdebug I have a file /home/vader/public_html/someclient/somesite/drupal/web/phpinfo.php with this code: <?php echo 1; echo 2; die; I load http://somesite.local/phpinfo.php and I see 12. Then in Sublime Text, next to the echo 1; I right click and choose 'Xdebug -- Add/Remove Breakpoint' and I see that it adds a brown dot (image attached). Then I select 'Xdebug -- Start Debugging' in Sublime (and it opens two windows on the bottom of the display) and I select "Debug" in my Firefox Xdebug helper extension (so the icon is green). I refresh the page http://somesite.local/phpinfo.php and I see 12. I was expecting to see 1 or to see nothing, and then to see some way to examine variables etc. in Sublime. Quote Link to comment https://forums.phpfreaks.com/topic/317506-trouble-with-xdebug-breakpoint-using-sublime-text/#findComment-1613315 Share on other sites More sharing options...
Solution kicken Posted December 5, 2023 Solution Share Posted December 5, 2023 On 12/4/2023 at 8:25 AM, VaderDark said: xdebug.mode develop develop In order to use step debugging, xdebug.mode needs to contain debug. If it still does not work after adding that, try setting xdebug.start_with_request to yes. I have not used either sublime or that browser extension, so not sure if they need anything special. Quote Link to comment https://forums.phpfreaks.com/topic/317506-trouble-with-xdebug-breakpoint-using-sublime-text/#findComment-1613327 Share on other sites More sharing options...
VaderDark Posted December 5, 2023 Author Share Posted December 5, 2023 (edited) I added those settings, and now I see some output (finally) in my xdebug.log file. With that, I was able to update more settings and I got it to work. Thank you!! Edited December 5, 2023 by VaderDark Quote Link to comment https://forums.phpfreaks.com/topic/317506-trouble-with-xdebug-breakpoint-using-sublime-text/#findComment-1613330 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.