Open jeancf opened 9 years ago
CGI-Node expecting "process.env.PATH_TRANSLATED" to be the full path of the javascript file to be executed. "PATH_TRANSLATED" is added to the environment variable when Apache executes Node.js as a CGI. I think lighttpd uses a different environment variable name (not sure but it could be PATH_INFO).
Try printing out the lighttpd environment variables and see which one points to the javascript file and update cgi-node.js accordingly (/srv/http/cgi-bin/cgi-node.js: Line number: 960, column: 46).
Let me know if this works. If not, I can setup a similar environment on my Raspberry PI and debug it.
Hope this helps.
Great feedback, thanks!
Actually I found on this PHP manual page the following note:
As of PHP 4.3.2, PATH_TRANSLATED is no longer set implicitly under the Apache 2 SAPI in contrast to the situation in Apache 1, where it's set to the same value as the SCRIPT_FILENAME server variable when it's not populated by Apache. This change was made to comply with the CGI specification that PATH_TRANSLATED should only exist if PATH_INFO is defined. Apache 2 users may use AcceptPathInfo = On inside
httpd.conf
to define PATH_INFO.
When I replaced process.env.PATH_TRANSLATED by process.env.SCRIPT_FILENAME in cgi-node.js
as you indicated I was able to get the cgiNodeInfo() content properly.
Cheers,
/~JC
Confirmed. I use NAS4Free based on FreeBSD 9 with built-in lighttpd. To make it run:
cgi.assign += ( ".jscript" => "/path/to/script/cgi-node.js")
I am trying to install cgi-node on a Raspberry Pi (ARM6) running Arch Linux, Lighttpd 1.4.35 and nodejs 0.10.35.
I transposed the installation procedure described in the GoDaddy tutorial as best as I could. However when I try to load a page containing
<? cgiNodeInfo() ?>
I get the following error in red on the page:Which I think is a nodejs error message.
My lighttpd.conf:
Thanks for your help.