Re: Euphoria MVC updates
- Posted by jmduro Oct 26, 2021
- 4001 views
Hi Greg,
To avoid any development server crashes and problems with web server versions, I decided to use lighttpd which is light, cross platform and allows to use dedicated configuration files per project.
In each project folder, I only need to create 4 sub-folders:
├───conf ├───logs ├───tmp └───www
logs and tmp are empty. conf contains a copy of lighttpd conf subfolder with parameters specific to the project.
cgi.assign = ( #-- Most relevant line: ".ex" => "C:\euphoria4.1_32\bin\eui", #-- Shrouded Euphoria scripts as CGI, runs faster: ".il" => "C:\euphoria4.1_32\bin\eub", ".cgi" => "", )
Euphoria files are located in www. In the project root folder, I create a file to launch lighttpd with the specific configuration.
C:\data\euphoria\v4\Perso\server>type lighttpd.bat "C:\WinApps\lighttpd\lighttpd.exe" -D
It never crashes and reports OEU errors as usual.
Unfortunately, it shows errors with example3.ex on Windows:
C:\data\euphoria\v4\Perso\server>"C:\WinApps\lighttpd\lighttpd.exe" -D 2021-10-26 08:41:18: (server.c.1083) trying to read configuration (test mode) 2021-10-26 08:41:18: (server.c.1471) server started (lighttpd/1.4.48) C:\euphoria4.1_32\include\mvc\utils.e:188 <0074>:: Errors resolving the following references: 'hwnd' (C:\euphoria4.1_32\include\mvc\utils.e:188) has not been declared. 'TRUE' (C:\euphoria4.1_32\include\mvc\utils.e:188) has not been declared. c_func( xShellExecuteA, {hwnd,allocate_string("open",TRUE),allocate_string(url,TRUE),NULL,NULL,SW_SHOWNORMAL} ) ^ Press Enter
With example4.ex and last line replaced by app:run(), there is one more error:
'LOG_ALL' (example4.ex:45) has not been declared.
If I comment the unneeded start_url procedure in mvc/utils.e, I get an HTTP 500 Internal error with following warnings first time:
2021/10/26 09:05:04 WARN getenv@utils.e:54 Environment variable not found: "SERVER_SIGNATURE" 2021/10/26 09:05:04 WARN getenv@utils.e:54 Environment variable not found: "PATH_INFO" 2021/10/26 09:05:04 WARN getenv@utils.e:54 Environment variable not found: "QUERY_STRING"
On next attempts, warnings are not displayed anymore but this error:
2021-10-26 09:05:53: (mod_cgi.c.1031) CGI pid 6088 died with signal 11
Jean-Marc