Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display friendly error message when spawning CGI process fails #127

Open
GoogleCodeExporter opened this issue Aug 28, 2015 · 9 comments
Open

Comments

@GoogleCodeExporter
Copy link

GoogleCodeExporter commented Aug 28, 2015

See https://github.com/cztomczak/phpdesktop/wiki/Knowledge-Base#error-500-internal-server-error-cannot-spawn-cgi-process-cdocuments-and-settingswwwindexphp-no-such-device-or-address

If you try to run phpdesktop with PHP 5.6 on Windows XP you will get error message like this:

  Error 500: Internal Server Error
  Cannot spawn CGI process [C:\...\phpdesktop\www/index.php]: No such device or address

This can be fixed similarly as in Issue #131 by using CefLoadHandler::OnLoadError.

See also Issue #74 that displays a friendly error message for other case.

Original issue reported on code.google.com by [email protected] on 7 Oct 2014 at 4:32

@okobsamoht
Copy link

hi! i'm having the same problem!

@timint
Copy link

timint commented Jan 15, 2025

I got this error with both the previous version and the v130 test release in Windows 11 24H2. The previous version did work up to a point in time. I suspect it could be related to an update of a .net framework runtime or similar? Any clues?

- WARNING: spawn_process: CreateProcess(php\php-cgi.exe "www\index.php"): 193
- 14:54:51.766 INFO: GET 500 /
Error 500: Internal Server Error
Cannot spawn CGI process [www\/index.php]: No such device or address

@cztomczak
Copy link
Owner

@timint Try launching php-cgi.exe process manually from command line and see if it throws any errors.

@timint
Copy link

timint commented Jan 15, 2025

Thank you for replying.
No errors, I get the rendered HTML output.

@cztomczak
Copy link
Owner

@timint Are you sure your www/ and php/ folders are correct and settings are proper? Can you download default unmodified binaries once again and test them?

From your logs I can see error code 193 for spawn_process which means "is not a valid win32 app" (googled), so something wrong is with the php-cgi.exe binary, or maybe path is wrong?

@timint
Copy link

timint commented Jan 15, 2025

I think I am on to something. The v130 download works when executed from C:\Users\Me\Downloads\phpdesktop-chrome-130.0-php-8.3.

But it doesn't when I copy it to D:\Projects\Folder with space char\phpdesktop-chrome-130.0-php-8.3. So could it be the space character in the path? Funny thing is it used to work from this path until it just one day stopped.

@cztomczak
Copy link
Owner

Hmm looks like a bug. Please create an issue for that.

PHP doesn't support paths with unicode characters [1], but spaces should work fine.

[1] https://github.com/cztomczak/phpdesktop/wiki/Knowledge-Base#error-when-application-is-placed-in-a-path-that-contains-unicode-characters

@timint
Copy link

timint commented Jan 16, 2025

There are only a-z chars in my path. The settings file have the relative path "cgi_interpreter": "php/php-cgi.exe", and the log window shows this:

- 15:13:38.625 WARNING: spawn_process: CreateProcess(D:\Projects\Folder with space char\phpdesktop-chrome-130.0-php-8.3\php\php-cgi.exe "D:\Projects\Folder with space char\phpdesktop-chrome-130.0-php-8.3\www\index.php"): 193

The path to .exe does not wrap around quotes ". But maybe that's just the way the debug text is output?

@cztomczak
Copy link
Owner

You are right, the quotes around path are missing. The source code in question is here: https://github.com/cztomczak/phpdesktop/blob/chrome130/mongoose.c#L1378

I am not sure how it worked earlier. I recall installing phpdesktop to program files which has a space and it worked fine in the past hmm.

Please create an issue in the tracker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants