<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ToqaDev91</title>
    <description>The latest articles on DEV Community by ToqaDev91 (@toqadev91).</description>
    <link>https://dev.to/toqadev91</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F367237%2F37b09a26-c22f-4f55-88ea-fac2b7f7008b.png</url>
      <title>DEV Community: ToqaDev91</title>
      <link>https://dev.to/toqadev91</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/toqadev91"/>
    <language>en</language>
    <item>
      <title>Vagrant with xdebug</title>
      <dc:creator>ToqaDev91</dc:creator>
      <pubDate>Tue, 28 Dec 2021 16:33:37 +0000</pubDate>
      <link>https://dev.to/toqadev91/vagrant-with-xdebug-41ke</link>
      <guid>https://dev.to/toqadev91/vagrant-with-xdebug-41ke</guid>
      <description>&lt;p&gt;Finally i found the problem ,&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;change the vagrant timezone to be same as host timezone
server xdebug configuration .ini file changed to be :
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;xdebug.idekey=VSCODE
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.remote_autorestart = 1
xdebug.client_port=9003
xdebug.discover_client_host=1
xdebug.max_nesting_level = 512
xdebug.log_level=10
xdebug.connect_timeout_ms=600
xdebug.log=/var/log/xdebug/xdebug33.log
xdebug.show_error_trace=true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;note that this configuration related to xdebug V3&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;in vagrant file , add port 80 as forwrded_port to be like this
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Vagrant.configure(2) do |config|
  config.vm.box_url = "file:///Users/toqaabbas/projects/theqar_vagrant/ubuntu16_php7.4_vagrantbox"
  config.vm.box = "baazbox"
  config.vm.provider "virtualbox" do |v|
    v.memory = 5120
    v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate//var/www","1"]
    v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/var/www","1"]
  end

  #config.vm.box = "ubuntu/xenial64"
  config.vm.network "private_network", ip: "192.168.33.33"
  config.vm.network "forwarded_port", guest: 80, host: 80 
  config.vm.provision :shell, :inline =&amp;gt; "sudo rm /etc/localtime &amp;amp;&amp;amp; sudo ln -s /usr/share/zoneinfo/Asia/Amman /etc/localtime", run: "always"

  config.vm.synced_folder "../", "/var/www"

  config.vm.provision "fix-no-tty", type: "shell" do |s|
    s.privileged = false
    s.inline = "sudo sed -i '/tty/!s/mesg n/tty -s \\&amp;amp;\\&amp;amp; mesg n/' /root/.profile"
  end

  config.vm.provision "file", source: "root", destination: "~"
  config.vm.provision :shell, path: "setup_vagrant.sh"
  config.vm.box_check_update = false
end

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and then run "vagrant reload" to re-build vagrant again&lt;br&gt;
finally change lanuch.json to be :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for Xdebug",
            "type": "php",
            "request": "launch",
            "port": 9003,
            "pathMappings": {
                "/var/www" : "/Users/myusername/projects"
            },
        },
        {
            "name": "Launch currently open script",
            "type": "php",
            "request": "launch",
            "program": "${file}",
            "cwd": "${fileDirname}",
            "port": 9003
        }
    ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the most important part was the correct location of "pathMappings"&lt;/p&gt;

&lt;p&gt;and finally it's works :)&lt;/p&gt;

</description>
      <category>xdebug</category>
      <category>php</category>
      <category>vagrant</category>
      <category>vscode</category>
    </item>
  </channel>
</rss>
