{"id":5114,"date":"2019-10-22T03:47:45","date_gmt":"2019-10-22T03:47:45","guid":{"rendered":"http:\/\/myprojects.advchaweb.com\/?p=5114"},"modified":"2023-08-11T09:34:55","modified_gmt":"2023-08-11T09:34:55","slug":"configure-vscode-with-xdebug","status":"publish","type":"post","link":"https:\/\/myprojects.advchaweb.com\/index.php\/2019\/10\/22\/configure-vscode-with-xdebug\/","title":{"rendered":"Configure VSCode with XDebug"},"content":{"rendered":"<p>Check if xdebug is already installed: http:\/\/localhost:8080\/phpinfo.php<br \/>\nFind the config file (ini file) on the above page then open it<br \/>\n&lt;XDEBUG 2.X&gt;<\/p>\n<pre class=\"lang:default decode:true \">sudo gedit \/etc\/php\/7.3\/fpm\/conf.d\/20-xdebug.ini<\/pre>\n<p>Make sure it&#8217;s enabled<\/p>\n<pre class=\"lang:default decode:true \">zend_extension=xdebug.so\r\nxdebug.remote_enable = 1\r\nxdebug.remote_autostart = 1<\/pre>\n<p>Then restart php7.3-fpm service<\/p>\n<pre class=\"lang:default decode:true \">sudo service php7.3-fpm restart<\/pre>\n<p>Check the xdebug properties on the page above: http:\/\/localhost:8080\/phpinfo.php<\/p>\n<p>Open VSCode then find and install &#8216;PHP Debug&#8217; extension<br \/>\n&lt;\/XDEBUG 2.X&gt;<\/p>\n<p>&lt;XDEBUG 3.X&gt;<\/p>\n<pre class=\"lang:default decode:true\">sudo gedit \/etc\/php\/7.2\/apache2\/conf.d\/20-xdebug.ini<\/pre>\n<p>ALSO FOR THE OTHERS PHP (7.4, 8.0, 8.1, 8.2)<\/p>\n<pre class=\"lang:default decode:true \">sudo gedit \/etc\/php\/7.4\/apache2\/conf.d\/20-xdebug.ini\r\nsudo gedit \/etc\/php\/8.0\/apache2\/conf.d\/20-xdebug.ini\r\nsudo gedit \/etc\/php\/8.1\/apache2\/conf.d\/20-xdebug.ini\r\nsudo gedit \/etc\/php\/8.2\/apache2\/conf.d\/20-xdebug.ini\r\n<\/pre>\n<p>Make sure it&#8217;s enabled<\/p>\n<pre class=\"lang:default decode:true\">zend_extension=xdebug.so\r\nxdebug.mode= debug\r\nxdebug.start_with_request = yes\r\nxdebug.discover_client_host = true\r\nxdebug.max_nesting_level=512\r\nxdebug.idekey = VSCODE<\/pre>\n<p>Then restart apache2 service<\/p>\n<pre class=\"lang:default decode:true\">sudo service apache2 restart<\/pre>\n<p>Check the xdebug properties on the page above: http:\/\/localhost:8080\/phpinfo.php<\/p>\n<p>&lt;\/XDEBUG 3.X&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Check if xdebug is already installed: http:\/\/localhost:8080\/phpinfo.php Find the config file (ini file) on the above page then open it &lt;XDEBUG 2.X&gt; sudo gedit \/etc\/php\/7.3\/fpm\/conf.d\/20-xdebug.ini Make sure it&#8217;s enabled zend_extension=xdebug.so xdebug.remote_enable = 1 xdebug.remote_autostart = 1 Then restart php7.3-fpm service sudo service php7.3-fpm restart Check the xdebug properties on the page above: http:\/\/localhost:8080\/phpinfo.php Open VSCode &hellip; <a href=\"https:\/\/myprojects.advchaweb.com\/index.php\/2019\/10\/22\/configure-vscode-with-xdebug\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Configure VSCode with XDebug&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48],"tags":[],"class_list":["post-5114","post","type-post","status-publish","format-standard","hentry","category-php-2"],"_links":{"self":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/5114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/comments?post=5114"}],"version-history":[{"count":5,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/5114\/revisions"}],"predecessor-version":[{"id":10814,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/5114\/revisions\/10814"}],"wp:attachment":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/media?parent=5114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/categories?post=5114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/tags?post=5114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}