Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xdebug not working in PHPStorm IDE

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.

like image 931
Vishnu Avatar asked Jun 19 '14 11:06

Vishnu


2 Answers

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.

like image 169
Pablo Moltedo Avatar answered Sep 19 '22 19:09

Pablo Moltedo


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.

like image 35
lance fallon Avatar answered Sep 21 '22 19:09

lance fallon