lua-users home
lua-l archive

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


Hi,
I am porting the CGILua to SHTTPD (Simple httpd), but I got error when I load 
the CGILua.lua, when it execute the <require "CGILua.urlcode"> line. I know CGILua
has no problem and I run it successfully in IIS.  I must missed something.
So I write some simple script for test:

test.lua :
require "test.cgi"

cgi.lua
module "test.cgi"

when I excute the test.lua, the interpreter report error like below:

lua51: test.lua:6: module 'test.cgi' not found:
        no field package.preload['test.cgi']
        no file '.\test\cgi.lua'
        no file 'D:\prestudy\shttpd-1.33\lua\test\cgi.lua'
        no file 'D:\prestudy\shttpd-1.33\lua\test\cgi\init.lua'
        no file 'D:\prestudy\shttpd-1.33\test\cgi.lua'
        no file 'D:\prestudy\shttpd-1.33\test\cgi\init.lua'
        no file '.\test\cgi.dll'
        no file 'D:\prestudy\shttpd-1.33\test\cgi.dll'
        no file 'D:\prestudy\shttpd-1.33\loadall.dll'
        no file '.\test.dll'
        no file 'D:\prestudy\shttpd-1.33\test.dll'
        no file 'D:\prestudy\shttpd-1.33\loadall.dll'
stack traceback:
        [C]: in function 'require'
        test.lua:6: in main chunk
        [C]: ?

So, I create a sub directory named "test" and move the "cgi.lua" into it.
Then it works. But the CGILua don't work this way, all it's files are in the 
same way.

Could you please tell me what's wrong?

Regards,
Jason