Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

prodigy10's avatar

Configuring PHPStorm, XDEBUG and VAGRANT

Hello, I have been trying to set up a nice debugging environment on my developing machine and I haven't been doing much progress. I am using OSX to run PHPStorm and my Laravel 5.1 is running on an Ubuntu Vagrant Box. So I installed xdebug on my MAC using brew and configure my PHP interpreter to point to /usr/bin/php on and set the php.ini to point to the executable there. PHPStorm has to picked up on that. My question is: Shouldn't Xdebug be running on the server? Has anybody done this setup before?

0 likes
8 replies
jimmck's avatar

Well right now it sounds like you can debug locally. Just turn on debug in Storm and set a breakpoint in a controller. It should stop and display it in Storm. You need to install xdebug remotely on the sever. Both in the HTTP PHP and the CLI PHP if you want to debug command line PHP. Make sure the xdebug port is open in remote server, i.e. not blocked by the OS. Config Storm session to remote server. Storm support site has great videos on doing this.

jimmck's avatar

Hi,

No you have a local server and a remote server. You have to add xdebug to each php.ini local and remote. Brew makes that easy on a MAC. As far as Apache goes, just make sure to install xdebug in the PHP it is using, local or remote.

bobbybouwmann's avatar
Level 88

I believe he is, but since you use mac it's really easy to setup a php environment on your local machine. However I'm a big fan of Homestead and I use it on my mac as well, but never had the needs to use XDEBUG. As mentioned before you need to set it up correctly on your server and locally.

I found this tutorial between my favourites: http://www.sitepoint.com/install-xdebug-phpstorm-vagrant/

jimmck's avatar

@prodigy10 Hey. What are your specific issues? I dont use Vagrant, but I looked at the settings in your link. As long as you can confirm it uses 20-xdebug.ini. Make sure the ports in Storm matchup with server settings. You may need to set an IDKEY.

Please or to participate in this conversation.