Giter Club home page Giter Club logo

Comments (13)

silvioprog avatar silvioprog commented on July 19, 2024

Fixed (45df610). Please test it. Thank you! :)

from brookframework.

leledumbo avatar leledumbo commented on July 19, 2024

Sorry for the late reply, just remembered about this issue. The charset problem is fixed, but action already exists and binary execution problem is still there. The problem is still exactly as above. Moreover, by default, the project is not runnable even though I choose FastCGI. Is this intended?

from brookframework.

leledumbo avatar leledumbo commented on July 19, 2024

Closed by mistake

from brookframework.

silvioprog avatar silvioprog commented on July 19, 2024

No problem friend. These days I was away partying the Christmas. :)
Finally, the problem in action editor is solved (e3f5567). Now, I'm using the "Index" instead "Data" property.
About the "error 88", what's your environment (Linux, Windows, Apache ...)? I'm using Apache (32/64bit) on Linux and Windows, and it works fine with CGI and/or FastCGI.
The intended is to disable the "Run" button. You could to run a CGI inside the IDE? I've never tried it, because the CGI/FCGI depend of environment variables to work.

from brookframework.

leledumbo avatar leledumbo commented on July 19, 2024

OK, I'll pull again.
About error 88, I'm using Nginx on 32-bit Linux. Nginx doesn't manage the FastCGI binary by itself and we have to start the binary ourselves. Moreover, I'll need to run from IDE in order to debug. That's what I did with my fpweb projects.

from brookframework.

silvioprog avatar silvioprog commented on July 19, 2024

If the error in the action editor occurs again, we will solve it.
I have the Linux Mint (64bit), I'll try to install Nginx to reproduce the problem with error 88.
So, by default, fpWeb keeps the Run button enabled? If yes, I may change the brookex to maintain compatibility with fpWeb.

from brookframework.

leledumbo avatar leledumbo commented on July 19, 2024

Yes, even it's enabled for CGI, though it's relevant only in FastCGI.

from brookframework.

silvioprog avatar silvioprog commented on July 19, 2024

Hm... so it would be interesting to let enabled for CGI and FastCGI?

from brookframework.

silvioprog avatar silvioprog commented on July 19, 2024

[I'm downloading the Nginx for Windows to reproduce the error 88: http://nginx.org/en/docs/windows.html]

from brookframework.

leledumbo avatar leledumbo commented on July 19, 2024

I'd say let it enabled for FastCGI only.
You don't need to download any webserver, since the error happens immediately after starting the binary.

from brookframework.

silvioprog avatar silvioprog commented on July 19, 2024

Now the Run button is enabled for FastCGI applications (a8e0cfc). Thank you!

Yes, after starting the binary, I got:

C:\Users\silvioprog\Desktop\fcgi>cgi1.exe
Exception at 00434BAC: Exception:
Failed to open input-handle passed from server. Socket Error: 6.

But...

For FastCGI applications, maybe you must be specify the port. Please test this demo, I specified a port (2015) to it:

http://www.sendspace.com/file/mwm0ct

In two pictures below, see FastCGI working:

1 - http://imagebin.org/240843
2 - http://imagebin.org/240844

I think that it will work now for you. :)

from brookframework.

leledumbo avatar leledumbo commented on July 19, 2024

YES!!! IT WORKS!!! I'll keep exploring the framework, it's damn big.
Now that you know FastCGI requires Port to be set, would you modify the generated project? IMO, it's better to put the Port initialization in the .lpr, but if you want to put it in Brokers (I don't really know what's this unit's job actually, request broker?), that's fine.

from brookframework.

silvioprog avatar silvioprog commented on July 19, 2024

Nice job guy! 👍

The Port is necessary when you use FastCGI manually (starting the executable via terminal). Using automatically (for example, in Apache) the Port used is the default.

In Brokers unit you configure any part of your application. The idea is exactly have a central point for you find everything related to initializations and settings. :)
E.g (pseudo example):

unit Brokers;

{$mode objfpc}{$H+}

interface

uses
  BrookApplication, BrookFCLCGIBroker, BrookSQLdbBroker, SQLite3Conn,
  BrookUtils, Classes, SysUtils;

implementation

var
  App: TBrookCGIApplication;
  EnvVars: TStringList;

initialization
  EnvVars := TStringList.Create;
  App := TBrookCGIApplication(BrookApp.Instance);
  App.GetCGIVarList(EnvVars);
  App.Email := 'webmaster@localhost';
  App.ApplicationURL := 'http://localhost';
  App.RedirectOnError := True;
  App.RedirectOnErrorURL := 'http://localhost/500.html';
  BrookSettings.Configuration := 'db.cfg';
  BrookSettings.Page404 :=
    '<html><head><title>Page not found</title></head><body>' +
    '<h1>404 - Page not found</h1></body></html>';

finalization
  FreeAndNil(EnvVars);

end.

from brookframework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.