By now, we’ve all learned to love Vagrant and the development flexibility it provides. No matter the platform, you can easily have a development environment up and running in no time that’s not only stable, but also identical in every regard to the environment your colleagues, mentors or mentees use. But as the applications we’re developing reside inside a virtual machine, they’re a bit tricky to debug with XDebug which is, by default, tuned for localhost.
XDebug is a PHP extension which allows you to debug and profile your code, view detailed and readable stack traces when errors happen, and much more. For a detailed walkthrough, see Shameer’s post. If you’re completely unfamiliar with it, you would do well to first install it following the procedures below, and then refer to the post linked above for a breakdown of everything XDebug can do for you and your apps.
In this tutorial, we’ll set up XDebug with PHPStorm for Vagrant hosted PHP apps.
Preparation
To prepare the environment, please install and boot Homestead.
Once it’s booted, vagrant ssh
into it, and install a sample Laravel app. You can do this by executing:
composer create-project laravel/laravel Laravel --prefer-dist
When you get the Laravel greeting screen, you’re good to go.
Installing XDebug
This step can be skipped. Homestead comes with XDebug installed and enabled. You can see this by looking at phpinfo() after booting Homestead:
or by checking out the conf.d folders of PHP FPM and PHP CLI:
ls /etc/php5/fpm/conf.d
ls /etc/php5/cli/conf.d
Continue reading %How to Install Xdebug with PHPStorm and Vagrant%
more
{ 0 comments... » How to Install Xdebug with PHPStorm and Vagrant read them below or add one }
Post a Comment