phpdesktop icon indicating copy to clipboard operation
phpdesktop copied to clipboard

Missing quotes around the php-cgi executable causes CGI spawn_process error

Open timint opened this issue 10 months ago • 6 comments

In reference to: https://github.com/cztomczak/phpdesktop/issues/127#issuecomment-2595906636

Missing quotes around the php-cgi executable https://github.com/cztomczak/phpdesktop/blob/chrome130/mongoose.c#L1378

Causes CGI spawn_process error:

- 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

Results in HTTP 500

timint avatar Jan 16 '25 15:01 timint

How far are we from a next release? I tried building this thing with VS 2022 Build Tools. CEF went fine but phpdesktop crashed with a variety of build errors.

phpdesktop\cef\include\base\cef_ref_counted.h(487,32): error C2061: syntax error: identifier 'in_place_t' [phpdesktop\build\phpdesktop-chrome.vcxproj] (compiling source file '../main.cpp')

timint avatar Apr 13 '25 02:04 timint

Are you using CEF version 130.1.15+g34b05bb? As per instructions in README.

cztomczak avatar Apr 13 '25 17:04 cztomczak

I am looking at the vcxproj file and looks like Debug configuration is missing stdcpp17 flag: https://github.com/cztomczak/phpdesktop/blob/chrome130/phpdesktop-chrome.vcxproj#L126

Change to Release configuration when building and that should fix it.

cztomczak avatar Apr 13 '25 17:04 cztomczak

I'm an absolute amateur at C compiling. I figure there is a bit reading between the lines that I don't fully understand.

cd cef_binary/build/
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release ^
  -DUSE_SANDBOX=OFF ^
  -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=Release ^
  -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=Release ^
  -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=Release ^
  ..
ninja
user32.lib(USER32.dll) : error LNK2001: unresolved external symbol __delayLoadHelper2
tests\cefsimple\Release\cefsimple.exe : fatal error LNK1120: 1 unresolved externals
[379/384] Building CXX object tests\cefclient\CMakeFiles\cefclient.dir\browser\osr_d3d11_win.cc.obj
cl : Command line warning D9025 : overriding '/MD' with '/MT'
[380/384] Building CXX object tests\cefclient\CMakeFiles\cefclient.dir\browser\root_window_win.cc.obj
cl : Command line warning D9025 : overriding '/MD' with '/MT'
[381/384] Building CXX object tests\cefclient\CMakeFiles\cefclient.dir\browser\osr_window_win.cc.obj
cl : Command line warning D9025 : overriding '/MD' with '/MT'
[382/384] Building CXX object tests\ceftests\CMakeFiles\ceftests.dir\xml_reader_unittest.cc.obj
cl : Command line warning D9025 : overriding '/MD' with '/MT'
ninja: build stopped: subcommand failed.
cmake -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=Release ^
  -DUSE_SANDBOX=OFF ^
  -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=Release ^
  -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=Release ^
  -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=Release ^
  ..
msbuild cef.sln
mt.exe : general error c101008d: Failed to write the updated manifest to the resource of file
...

And about 5 000 more red lines of errors... 😞

timint avatar Apr 13 '25 20:04 timint

So the building part is a complete discussion by it's own. I just need this thingy to run when there is a space character in the application path. Like C:\Program Files\phpDesktop.

timint avatar Apr 13 '25 20:04 timint

Okay, that should be easy to fix.

For the previous errors as per Cmakelists.txt this should work:

cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release ..
ninja cefclient cefsimple

cztomczak avatar Apr 13 '25 20:04 cztomczak