> Hello
>
> I checked the archives, but didn't find much.
>
> I'd like to use SQLite in a CGI script.
>
> After installing lsqlite3 through LuaRocks, I tried the following in a
> CGI script:
> ========
> print("\nHello, world")
>
> sqlite3 = require('lsqlite3')
>
> -- myDB=sqlite3.open('MyDatabase.sqlite3')
> -- myDB:close()
>
> ========
>
> However, uwsgi isn't happy:
> ========
> invalid CGI output !!!
> [pid: 3812|app: -1|req: -1/32] 192.168.0.1 () {34 vars in 607 bytes}
> [Wed Feb 26 16:26:37 2014] GET /sqlite.basic.lua => generated 0 bytes
> in 13 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0)
> ========
>
> The script works OK when called from the command line ("lua
> sqlite.basic.lua")
>
> Does uwsgi require something specific to load a Lua module in a CGI
> script?
>
> Thank you.
>
> _______________________________________________
> uWSGI mailing list
> [email protected]
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>
Please read a bit about CGI specs otherwise you are going in a pretty
random way.
A cgi script must be something like:
print("Content-Type: text/html\n\n")
print("Hello World")
or (at the very minimum, highly discouraged)
print("\n\nHello World")
eventually to set http status:
print("Status: 200 OK\n")
print("Content-Type: text/html\n\n")
print("hello again")
--
Roberto De Ioris
http://unbit.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi