WSL2 Xdebug PhpStorm Time-out connecting to client - phpstorm

I know it has been asked many times, but I tried 20 other solutions and spent all day and nothing seems to work.
I have WSL2 running PHP 7.4 + Xdebug 2.9.2 on Ubuntu 20.04 and using PhpStorm 2021.2 on a new Windows 11.
php.ini
zend_extension="/usr/lib/php/20190902/xdebug.so"
xdebug.remote_enable=1
xdebug.start_with_request=trigger
xdebug.discover_client_host=no
xdebug.idekey=PHPSTORM
xdebug.remote_port=9003
xdebug.remote_log="/var/log/xdebug/xdebug.log"
xdebug.remote_host=172.19.144.1
Logs
[29220] Log opened at 2022-01-10 18:54:56
[29220] I: Connecting to configured address/port: 172.19.144.1:9003.
[29220] E: Time-out connecting to client (Waited: 200 ms). :-(
[29220] Log closed at 2022-01-10 18:54:56
$ cat /etc/resolv.conf // nameserver 172.19.144.1

It was a simple network issue, it was Public network instead of private, so the port 9003 was being blocked, even though there was a firewall rule in place (including Public...).

Related

Cannot connect to localhost:3306 on MySQL Workbench on Mac

This is something that is recently happening. I don't know if it is due to updating my MAC OS. I am at macOS Catalina 10.15.4.
When I try to test my connection to localhost on 3306 I get the following:
Failed to Connect to MySQL at localhost:3306 with user root
If I go into System Settings I see the following:
If I try to start it the colored LEDs briefly go GREEN before going back to RED.
From the command line I have tried other solutions I have seen such as:
sudo /usr/local/mysql/support-files/mysql.server start
I get the following error:
Starting MySQL
. ERROR! The server quit without updating PID file (/usr/local/mysql/data/lester2s-Mini.pid).
Any thoughts on how I can get this working again?
Here is what I found at /var/log/system.log:
May 7 13:28:06 lester2s-Mini xpcproxy[3576]: libcoreservices: _dirhelper_userdir: 557: bootstrap_look_up returned (ipc/send) invalid destination port
May 7 13:28:06 lester2s-Mini com.apple.xpc.launchd[1] (com.oracle.oss.mysql.mysqld[3576]): Service exited with abnormal code: 2
May 7 13:28:06 lester2s-Mini com.apple.xpc.launchd[1] (com.oracle.oss.mysql.mysqld): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
May 7 13:28:12 lester2s-Mini com.apple.xpc.launchd[1] (com.oracle.oss.mysql.mysqld): This service is defined to be constantly running and is inherently inefficient.
May 7 13:28:12 lester2s-Mini xpcproxy[3582]: libcoreservices: _dirhelper_userdir: 557: bootstrap_look_up returned (ipc/send) invalid destination port
May 7 13:28:12 lester2s-Mini com.apple.xpc.launchd[1] (com.oracle.oss.mysql.mysqld[3582]): Service exited with abnormal code: 2
May 7 13:28:12 lester2s-Mini com.apple.xpc.launchd[1] (com.oracle.oss.mysql.mysqld): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.

PhpStorm + Xdebug + VMware VM = Time-out connecting to client

My Debian server (a VMware virtual machine) is up and running and all the settings in my PhpStorm are ok. I've set the virtual machine network adapter as bridged (also tried NAT).
My xdebug.ini looks like this:
zend_extension=xdebug.so
xdebug.profiler_enable=On
xdebug.remote_enable=On
xdebug.remote_host=MY_HOST_IP_ADDRESS
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.idekey=PHPSTORM
xdebug.remote_autostart=1
xdebug.remote_log="/tmp/xdebug.log"
Still, my xdebug.log looks pretty angry:
Log opened at 2018-07-01 14:54:08
I: Connecting to configured address/port: MY_HOST_IP_ADDRESS:9000.
E: Time-out connecting to client. :-(
Log closed at 2018-07-01 14:54:09
In fact, when I use telnet from my guest machine...
telnet MY_HOST_IP_ADDRESS 9000
Trying MY_HOST_IP_ADDRESS...
telnet: Unable to connect to remote host: Connection refused
I can't really get how to make this work after a couple of days. My SSH tunnel is also up and running (I've used the built in PhpStorm SSH tool), but even netcat doesn't help me out:
nc MY_HOST_IP_ADDRESS 9000
(UNKNOWN) [MY_HOST_IP_ADDRESS] 9000 (?) : Connection refused
This is my PhpStorm configuration (as you can see, the validation script looks good):
What am I missing?

wampserver 2.2 64x could not execute menu item (internal error)[Exception] Could not execute run action: the directory name is invalid

Working with the Wampserver 2.2 64x on win8.1, suddenly it has stopped starting services.its giving the following error:
wampserver 2.2 64x could not execute menu item (internal error)[Exception] Could not execute run action: the directory name is invalid
What i have done yet is start all Services/Restart All Services and restart wampserver, didn't work!
I tried to Install Service:
wampmanager -> Apache -> Service -> Install Service.
cmd saying Actually Port 80 is used by server:Microsoft HTTPAPI/2.0
But MySQL Install Service: wampmanager -> MySQL -> Service -> Install Service. doesn't work!
And also i tried to change port 80 (httpd.conf)
#Listen 12.34.56.78:80
Listen 80
to
#Listen 12.34.56.78:80
Listen 8080
after a restart of Wampserver its try icon got active(green) but still not working (giving the error)
Even i did System restore to the date where it was working with no errors but didn't work.
Any one know whats wrong with this?
This message from the test port 80 function
Actually Port 80 is used by server:Microsoft HTTPAPI/2.0
is saying that you have recently installed or activated IIS or maybe SQLServer.
Because the IIS or SQLServer services are configured to Start Automatically after a boot they have already grabbed Port 80 so when you start Apache it cannot get hold of port 80.
So either uninstall IIS or SQLServer or change their startup type using the Services snapin to Manual or even Disable them and then reenable them when you want to use them.
Things I know can grab port 80 and are related to IIS and SQLServer installs are
IIS
Web Deploy
MS Sql Server Reporting service.
BranchCache ( Windows 8.1 )
There may be others
How to find out whats using port 80
From a command window, started using "Start as Administrator" do
netstat -anop TCP | find ":80"
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 4852
Look at the result of this command and then put the PID number ( last number on the line ) into this command
tasklist /FI "PID eq 4852" ?FO TABLE /NH
httpd.exe 4852 Services 0 19,720 K
In this example Apache is using port 80 but yours will probably be something different
Easiest way to fix this i found was
- i uninstalled chrome so this broke down
just manually write locahost in explorer and works again.

my local mysql will not connect unless my computer is connected to wireless network

I have had a WAMP setup on my winXP laptop for many years with no problems.
But about 2 months ago I installed SiteKiosk (kiosk software that creates a 'shell' around the OS) on my laptop. Afterwards my HeidiSQL software quit working:
sql error (2003) in statement #0: can't connect to mysql server on
'127.0.0.1' (10061)
... so I have been using my browser-based phpmyadmin to connect/access my mysql since then.
About 2 weeks ago I uninstalled siteKiosk, but heidiSQL still wouldn't work.
.
Today I went to a client meeting at the client's office, with my laptop, to show them a new webapp. I did not connect to their wireless network. It is very common for me to demo webapps while being un-connected; I don't need to be, of course, because the webapps run on my localhost.
But today the webapp threw a php error:
Warning: mysqli::mysqli() [mysqli.mysqli]: [2002]
N o connection could be made because the target machine actively
(trying to connect via tcp://localhost:3306) in
C:\Server\htdocs\keleia.com\clients\client_prevent_deloza
\project_uDesign\php\pkg_meekrodb.php on line 177
... this is line 177:
$mysql = new mysqli($this->host, $this->user, $this->password,
$this->dbName, $this->port);
After the meeting, I came home, with my computer now connected to my home network, and the webapp worked fine. And so then I intentionally disconnected from my network, and again the webapp threw the 'not connected to mysql' error.
Any Thoughts about what is going on?
try to do "ping localhost" in cmd, compare the ip adresses with connected wifi and not.
if it's different so check your hosts file, or manually add line
127.0.0.1 localhost

MYSQL - Cant connect to MYSQL server on 'localhost' (10061)

Ive install wamp server on my PC(it has no internet or intranet connection, Windows XP -OS).
But when I access MYSQL this error popup.
Can you give any idea on how can i resolve this error.
thank you very much.
Cant connect to MYSQL server on 'localhost' (10061)
from the commandline (start/run/ type cmd, press ok), type:
telnet localhost 3306
If MySQL is running, you'll see the mysql version (and some garbage).
To see if the service is running, type:
sc query mysql
You'll see something like this if it's running:
SERVICE_NAME: mysql
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE,PAUSABLE,ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
To check to see if MySQL is running, provided its installed as a service you can go to Start -> Control Panel -> Administrative Tools -> Services (i may be a bit off on those paths, I'm an OS X / Linux user), and look for MySQL on that list. See if it is started or stopped.
You can then do a portscan if you really want to and determine if that port is open. There are all kinds of free tools online that will scan your IP and tell you which ports are open and what is listening on them.
Unless you did something during the install, I believe that the port will be standard and the service will NOT be running after install.
MySQL provides several GUI tools for managing servers: http://dev.mysql.com/downloads/gui-tools/5.0.html One of those tools is the "MySQL System Tray Monitor" which will detect the running service, and allow you to stop and start the server easily. You can also review the list of services for "MySQL" to see if that service is active.
If the service is running and you still can't connect, you need to make sure the Windows firewall is not blocking access to the port. If your firewall is not configured to notify you when it block a program (check the Windows Firewall control panel, it might not have notified you that it's detected the program).
Make sure it is running, check in my.cnf that it is really listening to the correct IP ( 127.0.0.1 ) and make sure you connect to the correct port aswell.
Try using telnet for debugging aswell and see where the problem lies, maybe mysql isnt started, or listens to a different port.
try to change a mysql port 3300 to "3306"