Xdebug Timeout Issue on Local with POST Requests and Superglobals

Hello everyone,

I’m using Xdebug to develop a WordPress plugin, and I’m encountering an issue while trying to debug POST requests. When I send a POST request with some data I want to inspect what’s being sent in the $_POST superglobal variable.

However, the problem I’m running into is that I keep getting a timeout error, usually after about a minute or so. To troubleshoot, I went into the folder for the site on Local, and I found an Apache, PHP, and MySQL folder. I searched through every file for a timeout keyword and updated any values I found to 600 (e.g., in PHP where it was set to 60, I increased it to 600). Unfortunately, this hasn’t resolved the issue. The timeout still happens, and I’m unable to properly use Xdebug for debugging.

Has anyone encountered a similar issue or have any suggestions for resolving this? Are there other settings or configurations I might be missing to prevent these timeouts and allow me to debug POST requests with Xdebug effectively?

Thanks in advance for your help!

Hey @jim453!

You mentioned searching for timeout but what about max_execution_time? Did you also increase that to 600?

Can you provide some more details for us as far as your specific OS/OS version, IDE, Local version, etc?

Keep us posted and we’d be happy to help further!

I noticed it happens with every breakpoint in php file. So not only when I do a Post Request. After around 40 to 50 seconds screen of browser gets white and shows error or just stays completely white. Then also xdebug stops

max_execution_time is even 1200 :smiley:

Local Version 9.0.5+6706
PHP Debug v1.35.0 Extension for VSCode
VSCode 1.94.2
Windows 10 Pro 22H2
PHP 7.4.30
Wordpress 6.6.2
Database MariaDB 10.4.10

I found this in site-error.log:

[Thu Oct 17 20:24:23.975859 2024] [fcgid:warn] [pid 17864:tid 1344] [client 127.0.0.1:49737] mod_fcgid: read timeout from pipe
[Thu Oct 17 20:24:23.976423 2024] [fcgid:warn] [pid 17864:tid 1344] (138)timed out: [client 127.0.0.1:49737] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function

in access log:

127.0.0.1 - - [17/Oct/2024:20:23:18 +0200] "GET /wp-admin/admin.php?page=mypage HTTP/1.0" 200 204704
127.0.0.1 - - [17/Oct/2024:20:23:37 +0200] "GET /wp-content/plugins/myplugin/mypagejavascript.js?ver=6.6.2 HTTP/1.0" 304 -
127.0.0.1 - - [17/Oct/2024:20:23:38 +0200] "GET /favicon.ico HTTP/1.0" 302 -
127.0.0.1 - - [17/Oct/2024:20:23:39 +0200] "GET /wp-admin/admin.php?page=mypage HTTP/1.0" 500 72424

and in error.log (what are these? I get them every minute, not only when there is time out)

[17-Oct-2024 18:20:56 UTC] Xdebug: [Step Debug] Time-out connecting to debugging client, waited: 200 ms. Tried: ::1:9003 (from HTTP_X_FORWARDED_FOR HTTP header), localhost:9003 (fallback through xdebug.client_host/xdebug.client_port) :-(
[17-Oct-2024 18:20:56 UTC] Xdebug: [Step Debug] Time-out connecting to debugging client, waited: 200 ms. Tried: ::1:9003 (from HTTP_X_FORWARDED_FOR HTTP header), localhost:9003 (fallback through xdebug.client_host/xdebug.client_port) :-(

any idea?

when I showed the site error-log to chatgpt it said I should add this section to apache2.conf.hbs.

<IfModule mod_fcgid.c>
    FcgidMaxRequestLen 30000000
    FcgidIOTimeout 1200  # Set to 10 minutes or more
    FcgidConnectTimeout 1200  # Set to 2 minutes
</IfModule>

I added it and restarted local but then the whole site doesnt run anymore. just got 502 error.

In Apache you can’t have comments on the same line as directives. So just add

<IfModule fcgid_module>
    FcgidIOTimeout 1200
</IfModule>

BTW there should already be a <IfModule fcgid_module> directive somewhere in conf\apache\site.conf.hbs so you can add the timeout there. FcgidMaxRequestLen is already set in module.conf.hbs, and FcgidConnectTimeout is for the initial connection so you don’t need that either.

Also, this is the correct solution to your original problem as FcgidIOTimeout defaults to 40 seconds. Personally I have it set to 600 in my Local projects.

1 Like