PHPStorm needs a bit of configuration, too. That’s all we need to configure on Xdebug’s end. Under that line, add the following options: xdebug.remote_enable = onĬlose the file and restart php-fpm: sudo service php5-fpm restart. Homestead’s default xdebug.ini file (found in /etc/php5/mods-available) originally only contains the directive that tells PHP to enable it, but nothing else: zend_extension=xdebug.so To allow Xdebug to be used remotely, we need to alter the ini file and give it some parameters that are off by default. If you’re using any other Vagrant box instead and xdebug isn’t present, refer to Shameer’s post for installation instructions. If you see xdebug.ini in there, it’s loaded. Or by checking out the conf.d folders of PHP FPM and PHP CLI: ls /etc/php5/fpm/conf.d You can see this by looking at phpinfo() after booting Homestead: Homestead comes with Xdebug installed and enabled. When you get the Laravel greeting screen, you’re good to go. You can do this by executing: composer create-project laravel/laravel Laravel -prefer-dist
#PHPSTORM DEBUG PHP INSTALL#
Once it’s booted, vagrant ssh into it, and install a sample Laravel app. To prepare the environment, please install and boot Homestead. In this tutorial, we’ll set up Xdebug with PHPStorm for Vagrant hosted PHP apps. 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. For a detailed walkthrough, see Shameer’s post. 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.
![phpstorm debug php phpstorm debug php](https://thecodingmachine.io/images/xdebug/xdebug_17.png)
![phpstorm debug php phpstorm debug php](https://cdn.deliciousbrains.com/content/uploads/2017/02/07162817/script-147_js_-_wp-migrate-db-pro_-____PLUGINS_wp-migrate-db-pro_.png)
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. 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. By now, we’ve all learned to love Vagrant and the development flexibility it provides.