getting error Too big headers 500 sometimes, restart fix

403 views
Skip to first unread message

danb...@gmail.com

unread,
Feb 12, 2019, 11:44:15 AM2/12/19
to PHP Desktop
Hello.
I tried using this app, and it works, but sometimes, I get Too big headers (even when I don't use PHP in that file). Restart fix this problem, but I don't know how to fix it without restart, as it ruins end user experience (as of my opinion)

Czarek Tomczak

unread,
Feb 12, 2019, 12:05:44 PM2/12/19
to PHP Desktop
What OS and PHP Desktop version? Can you provide steps that reproduce your problem?

danb...@gmail.com

unread,
Feb 12, 2019, 12:34:35 PM2/12/19
to PHP Desktop
Windows version 10.0.17134 Build 17134
PHP desktop v57(latest GitHub windows release)
Also, I have installed WinNMP (currently RUNNING), but I think it's not a problem (at least not what is starting the too big headers)

danb...@gmail.com

unread,
Feb 12, 2019, 12:36:26 PM2/12/19
to PHP Desktop
- 18:34:36.125 INFO: --------------------------------------------------------
- 18:34:36.125 INFO: Started application
- 18:34:36.125 INFO: Logging to: C:\Users\Dan\Documents\phpdesktop\debug.log
- 18:34:36.125 INFO: Log level = DEBUG4
- 18:34:36.125 INFO: Starting Mongoose 3.9c web server
- 18:34:36.125 INFO: WWW directory: C:\Users\Dan\Documents\phpdesktop\www
- 18:34:36.125 INFO: Index files: index.html,index.php
- 18:34:36.125 INFO: CGI interpreter: C:\Users\Dan\Documents\phpdesktop\php\php-cgi.exe
- 18:34:36.125 INFO: CGI pattern: **.php$
- 18:34:36.125 INFO: Hide files patterns:
- 18:34:36.125 INFO: CGI environment variables set: TMP=C:\Users\Dan\AppData\Local\Temp\,TEMP=C:\Users\Dan\AppData\Local\Temp\,TMPDIR=C:\Users\Dan\AppData\Local\Temp\,SERVER_NAME=127.0.0.1,PHPDESKTOP_VERSION=57.0
- 18:34:36.141 INFO: Web server url: http://127.0.0.1:44980/
- 18:34:36.141 INFO: remote_debugging_port = 49579
- 18:34:36.156 DEBUG: Command line string for the browser process: "C:\Users\Dan\Documents\phpdesktop\phpdesktop-chrome.exe" --no-sandbox --lang=en-US --log-file="C:\Users\Dan\Documents\phpdesktop\debug.log" --remote-debugging-port=49579
- 18:34:38.625 DEBUG: App::OnContextInitialized()
- 18:34:38.625 DEBUG: Window max width/height = 1286/680
- 18:34:38.625 DEBUG: GetBrowserWindow(): not found, hwnd = 919660
- 18:34:38.625 DEBUG: WindowProc(): event WM_GETMINMAXINFO: could not fetch BrowserWindow
- 18:34:38.625 DEBUG: BrowserWindow::CreateBrowserControl()
- 18:34:38.625 DEBUG: StoreBrowserWindow(): hwnd = 919660
- 18:34:38.016 DEBUG: Command line string for the gpu-process process: "C:\Users\Dan\Documents\phpdesktop\phpdesktop-chrome.exe" --type=gpu-process --no-sandbox --lang=en-US --log-file="C:\Users\Dan\Documents\phpdesktop\debug.log" --disable-direct-composition --supports-dual-gpus=false --gpu-driver-bug-workarounds=7,10,18,19,20,23,41,61,74 --disable-gl-extensions="GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent" --gpu-vendor-id=0x8086 --gpu-device-id=0x1616 --gpu-driver-vendor="Intel Corporation" --gpu-driver-version=20.19.15.4549 --gpu-driver-date=11-10-2016 --gpu-secondary-vendor-ids=0x10de --gpu-secondary-device-ids=0x1347 --lang=en-US --log-file="C:\Users\Dan\Documents\phpdesktop\debug.log" --service-request-channel-token=7C3E4E0E02A30452EB9681C1358294C0 --mojo-platform-channel-handle=1740 /prefetch:2
- 18:34:38.703 DEBUG: ClientHandler::OnAfterCreated()
- 18:34:38.719 DEBUG: SetCefBrowser() called in ClientHandler::OnAfterCreated()
- 18:34:38.734 DEBUG: OnLoadingStateChange: loading=1, url=
- 18:34:38.000 DEBUG: Command line string for the renderer process: "C:\Users\Dan\Documents\phpdesktop\phpdesktop-chrome.exe" --type=renderer --no-sandbox --primordial-pipe-token=4F492085D733C372AE48FB8703562970 --lang=en-US --lang=en-US --log-file="C:\Users\Dan\Documents\phpdesktop\debug.log" --enable-pinch --device-scale-factor=1 --num-raster-threads=2 --enable-main-frame-before-activation --content-image-texture-target=0,0,3553;0,1,3553;0,2,3553;0,3,3553;0,4,3553;0,5,3553;0,6,3553;0,7,3553;0,8,3553;0,9,3553;0,10,3553;0,11,3553;0,12,3553;0,13,3553;0,14,3553;0,15,3553;1,0,3553;1,1,3553;1,2,3553;1,3,3553;1,4,3553;1,5,3553;1,6,3553;1,7,3553;1,8,3553;1,9,3553;1,10,3553;1,11,3553;1,12,3553;1,13,3553;1,14,3553;1,15,3553;2,0,3553;2,1,3553;2,2,3553;2,3,3553;2,4,3553;2,5,3553;2,6,3553;2,7,3553;2,8,3553;2,9,3553;2,10,3553;2,11,3553;2,12,3553;2,13,3553;2,14,3553;2,15,3553;3,0,3553;3,1,3553;3,2,3553;3,3,3553;3,4,3553;3,5,3553;3,6,3553;3,7,3553;3,8,3553;3,9,3553;3,10,3553;3,11,3553;3,12,3553;3,13,3553;3,14,3553;3,15,3553 --service-request-channel-token=4F492085D733C372AE48FB8703562970 --renderer-client-id=3 --mojo-platform-channel-handle=2308 /prefetch:1
- 18:34:38.079 DEBUG: OnBrowserCreated()
[0212/183438.611:ERROR:child_thread_impl.cc(762)] Request for unknown Channel-associated interface: ui::mojom::GpuMain
- 18:34:40.547 INFO: GET 500 /
- 18:34:40.578 DEBUG: OnLoadingStateChange: loading=0, url=http://127.0.0.1:44980/
- 18:35:25.703 DEBUG: WM_DESTROY
- 18:35:25.703 DEBUG: RemoveBrowserWindow(): hwnd = 919660
- 18:35:25.734 INFO: Stopping Mongoose web server
- 18:35:25.734 DEBUG: Mongoose webserver stopped immediately
- 18:35:25.734 DEBUG: OnBeforeClose() hwnd=2950830
- 18:35:25.734 DEBUG: RemoveBrowserWindow(): hwnd = 2950830
- 18:35:25.734 DEBUG: GetBrowserWindow(): not found, hwnd = 2950830
- 18:35:25.734 WARNING: RemoveBrowserWindow() failed: GetBrowserWindow() failed
- 18:35:25.734 DEBUG: Calling CefQuitMessageLoop()
- 18:35:25.812 INFO: Ended application
- 18:35:25.812 INFO: -------------------------------------------------------




Latest log

Czarek Tomczak

unread,
Feb 12, 2019, 1:07:50 PM2/12/19
to PHP Desktop
Without steps that I can follow to reproduce the problem I can't much help you. I can only suggest that you make sure that these aren't your PHP scripts that are causing the problem. Also make sure that it isn't firewall interfering with application.

da...@pharaohtools.com

unread,
Feb 12, 2019, 3:41:01 PM2/12/19
to PHP Desktop
Hi @czarek , its Dave (@phpengine from Github). I'm also getting this issue, but it is consistent not intermittent, and I have all the steps to reproduce it.

I have two Ubuntu Laptops, both dell xps, one running Ubuntu 18.04 LTS, the other running Ubuntu 17.10.

Ubuntu 17.10, Expected Behaviour
Ubuntu 18.04, Failed Behaviour

Ive been making and running lots of changes over the past month or two, and I have seen it previously work on the 18.04 laptop. Maybe it was a previous release tarball that worked, I'm not sure. Any ideas?

Images included here: https://gist.github.com/phpengine/9c3c0b0b6c682b148adb26496b5510b8

The images include the install instructions, and the zip archive is located here: curl -X POST -O -J -d "control=BinaryServer&action=serve&item=pharaoh_virtualize_gui_linux_x64&version=0.0.2" https://repositories.internal.pharaohtools.com/index.php

The url in the images is different as it points to latest, which is currently that 0.0.2 specified. The curl above will still get the version in the issue, even if I publish a new one.

Let me know if that's enough info. I can probably put this onto Virtual Machines and provide OVA's if that helps.

Czarek Tomczak

unread,
Feb 12, 2019, 4:59:45 PM2/12/19
to PHP Desktop
@phpengine

What version of phpdesktop on each of these OSes? Version v72.1 ships with php-cgi that doesn't depend on the libpq5 library anymore (postgresql extension dependency).

What do you mean by "consistent"? Does the issue always reproduce or randomly when running the same instalation of phpdesktop using the same unchanged OS environment?

Are you using the default phpdesktop binaries with the default php.ini configuration? (with display_startup_errors=On)

There is a section on the Knowledge Base wiki page with more information on the "too big... http headers" error:

Error 500: Internal Server Error. CGI program sent malformed or too big (>16384 bytes) HTTP headers

That error may occur when php startup fails. It may be a problem with php.ini configuration. Or may be that php script sent malformed or too big headers. Similar messages were reported in the past for Python binaries in Python Desktop, in that case a dll library was missing. You have to run script from command line to see the php startup error message. Alternatively you can set display_startup_errors=On option in php.ini and you should see a graphical message about the real error (eg. loading extension failed). Problem reported in Issue #131.

This error may also occur when trying to load an incompatible php extension. PHP extensions are most often designed/compiled to work with a specific PHP version. You need to find out with what PHP version your dll extension is intended to work with. It's not only about PHP version number - but also whether this is x86 or x64, also there are TS and NTS variations of php. This all matters for your extension to load successfully. PHP shipped with phpdesktop is a x86 and a non-thread-safe version. PHP Desktop is not tied to any specific php version, you can replace PHP binaries by overwriting files in the php/ directory.

danb...@gmail.com

unread,
Feb 12, 2019, 9:31:52 PM2/12/19
to PHP Desktop
I cant tell steps because I don't know them. I just downloaded php desktop and put my own html there(it don't have any php in it for now) and then when I start, it sometimes show that error, sometimes not...

Czarek Tomczak

unread,
Feb 13, 2019, 1:50:03 AM2/13/19
to PHP Desktop
The error you report can occur only when handling CGI request, meaning when a PHP script is executed. So what you're saying, that it occurs when serving just html content, is strange. Here is the line code responsible for it in the "handle_cgi_request" function:

Czarek Tomczak

unread,
Feb 13, 2019, 1:54:12 AM2/13/19
to PHP Desktop
@danbulant
The error is definitely caused by PHP interpreter. PHP Desktop embeds PHP binaries and often issues are caused by PHP scripts or some bugs in the PHP interpreter itself. I suggest you try with a different version of PHP. Here are instructions on how to replace PHP in PHP Desktop: https://github.com/cztomczak/phpdesktop/wiki/Knowledge-Base#php-interpreter--extensions

Czarek Tomczak

unread,
Feb 13, 2019, 1:59:02 AM2/13/19
to PHP Desktop
@danbulant Please test if the issue occurs with default PHP desktop binaries - with no modifications at to www/ directory, php.ini file or the settings.json file. No modifications at all. If it still occurs then in next step replace PHP interpreter and test again with no other modifications.

Czarek Tomczak

unread,
Feb 13, 2019, 3:59:18 AM2/13/19
to PHP Desktop
@phpengine
Please create a separate topic for your issue. Provide phpdesktop logs from console from when issue occurs and when it doesn't - only from Ubuntu 18.04. Test with original phpdesktop v72.1 binaries with no files modified (www, settings or anything).

On Tuesday, February 12, 2019 at 8:41:01 PM UTC, phpengine wrote:

Czarek Tomczak

unread,
Feb 13, 2019, 4:32:42 AM2/13/19
to PHP Desktop
@danbulant Also when testing close all other applications running. Close any security software (antirus, firewall).

phpengine

unread,
Feb 13, 2019, 5:04:27 AM2/13/19
to PHP Desktop
@czarek, I just ran it from the original files as you mentioned and its fine. Ignore my issues for now, it's probably something I've done. I may have left old files in there. I'm continuing to work o this today with the assumption that I've done something wrong with the package as thats what it looks like at the moment. I'll open a seperate issue if something still seems wrong, but I think this'll be my last comment here, except maybe one to say "It's fixed and i did x,y and z". Thanks

Czarek Tomczak

unread,
Feb 13, 2019, 5:15:33 AM2/13/19
to PHP Desktop
@phpengine PHP Desktop's handling of error messages including startup errors is not perfect, but once you get things running it should be all good. There are several issues in the tracker to handle these errors better: https://github.com/cztomczak/phpdesktop/issues?q=is%3Aissue+is%3Aopen+label%3A%22friendly+error%22 .

danb...@gmail.com

unread,
Feb 13, 2019, 9:27:16 AM2/13/19
to PHP Desktop
It's completely random to occur - I just start the exe and it work, and sometimes show that error, without changing anything

Czarek Tomczak

unread,
Feb 13, 2019, 10:30:37 AM2/13/19
to PHP Desktop
Then your system might be broken, you can try running on another computer. Or it's a bug in the PHP interpreter. The issue occurs when executing PHP script and it is the PHP interpreter that is failing. You can file PHP bugs at https://bugs.php.net/ . If you want to debug this further, then see my previous posts.

danb...@gmail.com

unread,
Feb 13, 2019, 11:34:51 AM2/13/19
to PHP Desktop
What's the version of php in windows build? I didn't edited anything, just the title in config and www (now there's only html file). Can it be because of running another server on same machine (PHP 7.1 in WinNMP stack)

phpengine

unread,
Feb 13, 2019, 11:56:23 AM2/13/19
to PHP Desktop
It's fixed and just used the newest archive. I think I had left parts of a previous one in there. Human error on my part, Ignore it, thanks
Reply all
Reply to author
Forward
0 new messages