lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


ubuntu 11.04
apache     2.2.17
lua    5.1.4-5
cgilua    5.1.3

It fails for me?
If someone can tell me what is nil in both cases it would help.
Or how to debug this

shaun


PROGRAM
#!/usr/bin/env wsapi.cgi

module(..., package.seeall)

function hello(wsapi_env)
  local headers = { ["Content-type"] = "text/html" }

  local function hello_text()
    coroutine.yield("<html><body>")
    coroutine.yield("<p>Hello Wsapi!</p>")
    coroutine.yield("<p>PATH_INFO: " .. wsapi_env.PATH_INFO .. "</p>")
    coroutine.yield("<p>SCRIPT_NAME: " .. wsapi_env.SCRIPT_NAME .. "</p>")
    coroutine.yield("</body></html>")
  end

  return 200, headers, coroutine.wrap(hello_text)
end

*** apache output

There was an error in the specified application. The full error message
follows:

hw:3: bad argument #1 to 'module' (string expected, got nil)
stack traceback:
	[C]: in function 'module'
	hw:3: in main chunk
	[C]: in function 'dofile'
	/usr/share/lua/5.1/wsapi/common.lua:312: in function 'load_wsapi'
	/usr/bin/wsapi.cgi:21: in function 
	(tail call): ?
	[C]: in function 'xpcall'
	/usr/share/lua/5.1/wsapi/common.lua:147: in function 'run_app'
	/usr/share/lua/5.1/wsapi/common.lua:171: in function 'run'
	/usr/share/lua/5.1/wsapi/cgi.lua:18: in function 'run'
	/usr/bin/wsapi.cgi:26: in main chunk
	[C]: ?


Other web server output

There was an error in the specified application. The full error message
follows:

/usr/share/lua/5.1/wsapi/common.lua:189: bad argument #1 to 'match' (string expected, got nil)
stack traceback:
	[C]: in function 'match'
	/usr/share/lua/5.1/wsapi/common.lua:189: in function 'splitext'
	/usr/share/lua/5.1/wsapi/common.lua:204: in function 
	(tail call): ?
	/usr/bin/wsapi.cgi:16: in function 
	(tail call): ?
	[C]: in function 'xpcall'
	/usr/share/lua/5.1/wsapi/common.lua:147: in function 'run_app'
	/usr/share/lua/5.1/wsapi/common.lua:171: in function 'run'
	/usr/share/lua/5.1/wsapi/cgi.lua:18: in function 'run'
	/usr/bin/wsapi.cgi:26: in main chunk
	[C]: ?