7

I am trying to setup xdebug in PHPStorm IDE and I followed the steps mentioned in one document

I followed this document :"http://www.mysolutions.it/phpstorm-server-xdebug-configuration/".

But I am getting one error "Port 9000 is busy " and also if i run debug ,it is quitting.I will share my config settings

The steps I have done

In my Xdebug.ini

zend_extension="/usr/lib/php5/20090626/xdebug.so"
xdebug.default_enable = 1
xdebug.idekey = "vagrant"
xdebug.remote_enable = 1
xdebug.remote_autostart = 0
xdebug.remote_port = 9000
xdebug.remote_handler=dbgp
xdebug.remote_log="/var/log/xdebug/xdebug.log"
xdebug.remote_host="myip"

In PHP storm

File->settings->PHPservers
Host : Ip for the virtual machine(Ip added in the host file)
Port:80
Debugger:Xdebugger

I checked the checkbox (Use PathMappings)

Under that Project files (Absolute Path on the server : /var/www/myproj)

File->settings->Deployment

Connection:

Type : FTP FTP Host :my virtual machine ip port :80 Root path:/var/www

Mappings:

Local Path: /Users/m1019238/dev/myproject/myproj

Web Path on Server : /var/www/myproj

I will share anything if i missed any settings that i have done other than this. Also very sorry for my english.

nicael
  • 16,503
  • 12
  • 50
  • 80
Vishnu
  • 71
  • 1
  • 1
  • 5
  • 1
    **Port 9000 is busy** Make sure no other services using port `9000`. Type this `netstat -plnt | grep ':9000'` in your terminal and check what application is running with port 900 – Rahil Wazir Jun 19 '14 at 11:33
  • Hi @Rahil Wazir , I tried to run the command netstat -plnt | grep ':9000' m,it is not working in mac osx, – Vishnu Jun 19 '14 at 11:51
  • 1
    See here: http://stackoverflow.com/questions/4421633/who-is-listening-on-a-given-tcp-port-on-mac-os-x – Rahil Wazir Jun 19 '14 at 11:54
  • Try to setup by following this link http://www.dev-metal.com/setup-use-xdebug-phpstorm-locally-windows-78-mac-os-x/ – Always Sunny Jun 19 '14 at 12:40
  • Hi i tried lsof -n -i4TCP:$PORT | grep LISTEN ,it is working ,My port was listening to eclipse ide. – Vishnu Jun 19 '14 at 14:48
  • There are no applications running on port 9000 however it is still busy – decapo May 11 '17 at 21:40

3 Answers3

9

I've just change the port on "Build,execution, deployment" -> "Debugger" to something else like 9001 and the put it back to 9000. It was weird because PhpStorm itself was using the port.

Pablo Moltedo
  • 184
  • 1
  • 6
  • Hello. This should actually be a comment, not an answer. You can comment once you earn enough reputation. Cheers. – Cthulhu Mar 15 '16 at 15:47
  • Nah, this should be an answer. Comments are meant to be cleaned up … and to me this was the solution. – kaiser Oct 15 '16 at 22:47
  • This solution helpt me too, you can even leave the phpstorm port on 9001. – joronimo Jan 10 '17 at 21:24
2

For anyone else that may stumble upon this and don't want whack the entire config, you can find your PHPStorm configuration file path here: https://intellij-support.jetbrains.com/hc/en-us/articles/206544519-Directories-used-by-the-IDE-to-store-settings-caches-plugins-and-logs

Once you locate the config folder, a text search for the used port should locate the file that configures PHP to automatically use the port (assuming phpstorm is the application listening on it).

For me on a mac, it was in ~/Library/Preferences/PhpStorm2017.1/options/other.xml

<application>
    <component name="BuiltInServerOptions" builtInServerPort="9000" builtInServerAvailableExternally="true" />
</application>

The built in server defaulted to 9000. Changing this to something else fixed things. Note that for my case, turns out I also could have changed the Build,Execution,Deployment > Debugger > Port option in the IDE itself.

HDJEMAI
  • 7,766
  • 41
  • 60
  • 81
0

I just figured what was my mistake:

php-fpm was listening on 9000 so be sure you don't have php-fpm running and if so, you'll have to choose between changing your php-fpm port or your xdebug's one.

lenybernard
  • 2,199
  • 18
  • 22