Xdebug In Vagrant Laravel/homestead V0.4.0 / V3.0.1

- 1 answer

I set up a vagrant box laravel/homestead v0.4.0.
I install homestead V3.0.1 using composer.
Finally I run "vagrant up" and then "vagrant ssh" and i am inside the Homestead VM, but...

It supposed to include Xdebug, but it hasn't...
When I run phpinfo() there is no Xdebug info.
Also in /etc/php/7.0/fpm/php.ini or in the config.d folder, there is no configurations for Xdebug.

My final goal is to be able to debug a laravel project with Netbeans IDE. The project is running inside the homestead VM, but im stuck understanding why there is not Xdebug in the homestead virtual machine. Any help to achive this is highly appreciated



EDIT: As of version 0.4.1, XDebug was put back into Homestead. Compiling XDebug from source should no longer be necessary.

In your ~/.homestead directory, there should be a file called This will provide you a means by which you can execute your own commands after the Homestead provisioner has finished.

Copy and paste the following into your file:


# Install Xdebug
git clone git://
cd xdebug
./configure --enable-xdebug
make install

# Configure Xdebug
cat > /etc/php/mods-available/xdebug.ini <<EOL
ln -s /etc/php/mods-available/xdebug.ini /etc/php/7.0/fpm/conf.d/20-xdebug.ini
service php7.0-fpm restart

Once complete, run a vagrant destroy and a vagrant up, or run vagrant provision to ensure the shell command executes properly.

This version of XDebug is a direct clone of the Github Master branch. This branch is considered unstable. Once the Xdebug github account adds a branch for either 2.4 or 2.5, make sure to update your shell command to checkout that branch before running the various configuration and make commands.

Additionally, I'm only adding Xdebug to the FPM configuration. I am not adding it to the CLI configuration. You will likely see Xdebug only in a phpinfo() call, and not a php -i call.

Aside from that, I tested this on my own environment:

  • Homestead box version 0.4
  • Github clone laravel/homestead 3.0.1
  • PHPStorm IDE

Everything seems to work as expected. Let me know if this helps.