Skip to content

Display friendly error message when spawning CGI process fails #127

Open

Description

@GoogleCodeExporter

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 czarek.t...@gmail.com on 7 Oct 2014 at 4:32

Activity

  1. okobsamoht commented on Sep 10, 2015

    @okobsamoht

    hi! i'm having the same problem!

  2. timint commented on Jan 15, 2025

    @timint

    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
    
  3. cztomczak commented on Jan 15, 2025

    @cztomczak
    Owner

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

  4. timint commented on Jan 15, 2025

    @timint

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

  5. cztomczak commented on Jan 15, 2025

    @cztomczak
    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?

  6. timint commented on Jan 15, 2025

    @timint

    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.

  7. cztomczak commented on Jan 16, 2025

    @cztomczak
    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

  8. timint commented on Jan 16, 2025

    @timint

    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?

  9. cztomczak commented on Jan 16, 2025

    @cztomczak
    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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions