PHPStorm integration with Firefox

I cannot get Firefox to work interactively with PHPStorm. Any help would be greatly appreciated.

I thought I would try a more advanced tool to help with development a and PHPStorm seems to be a popular choice. So, I have installed version 2023.1.1 of PHPStorm, version 3.1.2 of xdebug and xdebug helper version 1.0.6 in Firefox.

I am running Apache2 with PHP 8.1 on Linux Mint 2.1.1.

My problem is getting them all to talk to each other. PHPStorm works. I run php scripts within it and follow class hierachies insert breakpoints etc. I can click on the Firefox icon in PHPStorm and the browser starts and executes the script in its entirety I.E. ignoring the breakpoints. I have the little bug on the bar for Fireox and set that to Debug. I have PHPStorm set to listen for Debug Connections. What have I got wrong/missed?

I have attached various images from my installation:-

Phpinfo extract showing Zend and xdebug settings.

PHPStorm Debugger and Deployment settings.

The additions for xdebug that I have appended to the php.ini file.

Firefox xdebug helper preferences.

Phpstorm’s run popout window showing that Listening has been selected.

 

0
3 comments

Hi there,

In general:

1. For Xdebug v3 better use special xdebug_info(); -- it's a bit better than phpinfo() as it also shows some diagnostics messages etc

2. Enable xdebug.log (restart web server if needed) and try to debug. It should write there where it tries to connect and what the response is etc.

 

Anyway -- this is WRONG (your 3rd screenshot; the one that shows 9003 port on the Debugger settings)

This for for built-in simple web server / internal comms / talking to JS debugger etc. Please revert it back (63342 by default) and restart the IDE.

Xdebug settings are under "PHP | Debug" node.

 

0

I have changed to use port 63342 and set up the xdebug log file. However I am not a lot further on.

Initially there is no activity on port 63342 but the moment I open PHPStorm there is a Java function listening on it. This opens even if I have not set PHPStorm to listen.

If I then switch on listening for xdebug I get the message saying ‘Can’t start listening for connections from ‘xdebug’ Port 63,343 specified in settings isbusy. Etc. (See image)

There is still nothing in thje xdebug log. When I click on the Firefox icon the page opens and theere is an entry in the xdebug log. I have to reload it to get the bug icon at the top and the entries are repeated in the xdebug log.

There is also a cookie for the session created (again see image)

0

You did it all wrong / must have misread my message.

- You should not have touched the Xdebug port at all / anywhere.

- I've only asked to restore that special debug port only (that is used for the IDE itself: internal web server / RPC / interprocess comms etc).

 

Initially there is no activity on port 63342 but the moment I open PHPStorm there is a Java function listening on it. This opens even if I have not set PHPStorm to listen.

That is correct behaviour for "Settings/Preferences | Build, Execution, Deployment | Debugger | Port" (see my previous sentence)

If I then switch on listening for xdebug I get the message saying ‘Can’t start listening for connections from ‘xdebug’ Port 63,343 specified in settings isbusy. Etc. (See image)

Absolutely expected since the port is already in use (the above)

There is still nothing in thje xdebug log.

Entries will appear there when you try to debug (the log is written by Xdebug itself when PHP executes the request / script).

 

Do this:

1. "Settings/Preferences | Build, Execution, Deployment | Debugger | Port" -- it's a built-in web server and its' better be the default 63342

2. Set Xdebug port to the default 9003 in both php.ini and the IDE: "Settings/Preferences | PHP | Debug | Debug port"

3. Restart the IDE.

4. Try to debug

0

Please sign in to leave a comment.