I'm trying to debug code that is on remote server.
I'm using
Ubuntu 16 server, LEMP, PHP 7.0 as remote server
OSX, PhpStorm, Chrome Xdebug helper as local environment
So, when
Xdebug connection is established by
ssh -R 9000:localhost:9000 {username}#{serverhost}
Xdebug helper in debug mode
PhpStorm start listening is enabled
Xdebug triggers to each requests not only from my browser or PhpStorm, but from all other users from the internet.
Is it normal?
Is it possible to watch only requests initiated from my PhpStorm or from my Chrome requests? If yes, so how to setup?
Xdebug triggers to each requests not only from my browser or PhpStorm, but from all other users from the internet.
Is it normal?
That depends on your Xdebug configuration. Right now it looks like it's configured to automatically attempt to debug every single request (not a good idea in many situations).
Is it possible to watch only requests initiated from my PhpStorm or from my Chrome requests? If yes, so how to setup?
Yes, make sure that xdebug.remote_autostart is turned off (set to 0/no).
Then just follow the official guide: https://www.jetbrains.com/help/phpstorm/debugging-with-phpstorm-ultimate-guide.html
Xdebug will see your Xdebug cookie set by Chrome Xdebug Helper (or GET/POST parameter if you pass it manually in URL/request) and will try to debug only those requests.
P.S. There is another scenarios where the aforementioned option will not help.. but so far it does not look like you are having that case (would need to see much more details for that).
Related
I have an Ubuntu server running Apache and PHP7, with Xdebug installed and confirmed in the phpinfo():
xdebug
xdebug support enabled
Version 2.6.0
IDE Key PHPSTORM
My PhpStorm is running on a Mac, a different machine. The webserver is running as it should. If I debug a PHP script from PhpStorm debugging also works fine. But if I add a breakpoint to my code in PhpStorm and run the PHP from a web browser the debugger doesn't seem to do anything. My code just executes. PhpStorm doesn't start debugging at my set breakpoint.
If I purposely add an error to my PHP code I can see by the output that Xdebug is doing something on the server, the error is presented in the xdebug-error table.
In the correct PHP.ini on the Ubuntu server I set the correct settings:
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.remote_host=192.168.0.130
So:
PhpStorm is listening for PHP Debug connections, or at least the "listen for debug connections" is enabled
Both are configures to listen/talk to port 9000
CLI interpreter is set correctly to the remote Ubuntu server
Path mapping is correct (in my case: /volumes/internet -> /var/www)
[Edit] Port scan on 9000 shows cslistener when PhpStorm is listening, when turned off there's nothing there
I would love to get my breakpoints working, what am I doing wrong?
xdebug.remote_host should not be set to the IP of the machine XDebug is running on, it should be set to the machine you're running PHPStorm on!
Another option is to set xdebug.remote_connect_back to true. When this is enabled the xdebug.remote_host setting is ignored and Xdebug will try to connect to the client that made the HTTP request. It checks the $_SERVER['HTTP_X_FORWARDED_FOR'] and $_SERVER['REMOTE_ADDR'] variables to find out which IP address to use. (See the XDEBUG manual)
Recently I installed Gatling for performance testing on Ubuntu 14.04. And to run the recorder I needed to configure a proxy server in my browser. I tried to change proxy settings in Google chrome, but I don`t have rights. So I tried to do it using network settings in Ubuntu (Network -> Network proxy). But when I open a website which I need to test, nothing happens in the recorder.
So I do not really know is there a problem with the proxy server or Gatling itself? And how to check if the proxy server is configured correctly?
I would appreciate any help!
It's a bit too late, but I had a similar problem today. Was able to solve only by setting global IP address like xxx.xxx.xxx.xxx. Nor localhost nor 127.0.0.1 worked for me Chrome. After that I was able to notice http requests in Recorder inside Executed Events
Hopefully it could help somebody else
Edit : this is how setting looks like in Chrome, taking into account you have specified in Recorder Listening port to be 8000 also:
I have never used PhpStorm before for remote development because I used to work locally.
I am wondering if there is a method to set PhpStorm to work in such a way so it will be identical, in terms of functionality, to local development?
At least, debugging and jumping to functions/variables declaration across the whole project?
Tried to google it but found nothing. Maybe someone knows?
There are two ways to work with remote server development :
With a physically server
With a Virtual Machine locally
Those 2 ways are identical workflow parameters for working with this.
In PHPStorm the main area for parameters workflow deployement on remote server is : PHPStorm > Settings > Build, Execution, Deployement > Deployement
In this area you config the connection on your remote server (you before must config access on your remote server). SFTP is the best way to use this connection.
Most important to select where you want to send/push your modified code with Root path. Upload manually or use the sync auto functionality of PHPStorm use this parameter.
Mappings tabs is not very important you can keep this without change except for 'Deployement path on server' which just type '/' character if you have selected the good 'Root Path' in tab before.
For starting you can forget the Excluded Paths tab. after if you work on symfony framework you use this to exclude the vendor directory.
Don't forget to set the options 'use as Default' if you want to upload or sync auto more fastly and friendly.
Now you must parameters and config correctly your remote server for server be able to run the code which send it with PHPStorm. Dependly on your framework or other technologies you use.
Finally you have :
PHPStorm config OK for send correctly your modification code (auto or manually)
remote server config OK for executing and running correctly the code you are before sending from PHPStorm to your server remote
WARNING : you never run your website into your local OS.
IMPORTANT : config a web server on your remote server and don't forget to install layer for PHP executing script.
PHPStorm 9 is being hit by non-stop Xdebug requests when I do not have the listener enabled in PHPStorm and I don't have it enabled in the browser Chrome extension.
These windows constantly pop-up disrupting my ability to use the IDE:
This started after I had to disable xdebug.remote_autostart setting due to conflicts causing PHP scripts run at the CLI level to hang.
Now every background queue that executes is triggering this incoming connection message.
Every time I delete the server *.dev from PHPStorm it shows back up again.
How do I stop this?
Below is the full value list from the Debugger console when these undesired requests come in:
I'm new to PhpStorm. I tried to use debugging for debuggin a Webpage and I configured it
After starting the debugger, it works for 40 seconds and then I get on the browser "500 Internal Server Error"
At this question Xdebug interrupts the running of PHP script they suggested to clear the watches. But in my Debugger there are no watches.
I use the PhpStorm with Ubuntu 14.04 and the web page is running on Apache
I used Eclipse before and I did not had this problem with XDebug.
Do someone has an idea?
Thanks to user LazeOne (who added a comment) I found the solution.
I added to my apache configuration (/etc/apache2/apache2.conf) the following line
FcgidIOTimeout 600 # for 10 minutes
and the debugger does not interrupt for the next 10 minutes