Vishnu
Vishnu

Reputation: 81

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.

Upvotes: 8

Views: 12635

Answers (3)

lenybernard
lenybernard

Reputation: 2448

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.

Upvotes: 0

lance fallon
lance fallon

Reputation: 59

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.

Upvotes: 2

Pablo Moltedo
Pablo Moltedo

Reputation: 314

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.

Upvotes: 11

Related Questions