开发者

Strange problem getting $ENV{'QUERY_STRING'}

开发者 https://www.devze.com 2023-01-30 04:11 出处:网络
I\'m having a strange problem here. I\'m moving a (working) site to a new apache server to which I don\'t have direct access (I have to go through two people to get stuff done).

I'm having a strange problem here. I'm moving a (working) site to a new apache server to which I don't have direct access (I have to go through two people to get stuff done).

The site uses a perl script called adframe to parse html templates. The URLs with which it's called look like /cgi-bin/adframe/index.html?x=something with adframe being the script. The missing suffix never caused any real problems. But on this new Ubuntu server $ENV{'QUERY_STRING'} is always empty. $ENV{'REQUEST_METHOD'} shows up correctly as GET, but the query_string shows nothing ...

Regular *.cgi scripts show the query_string without problems.

From the logs I gathered that the server seems to be running fastcgi, mod_fcgid and the server doesn't even accept .pl as an extension for scripts. I don't have that much experience with server software, but I figured it might be a problem with the server not accepting adframe as a cgi script and thus not passing the query_string correctly ... Can anyone give me a few hints to where I could point the administrator or maybe something I could do in .htaccess myself? Anyway to make sure, adframe is recognized as a cgi script!? (if that's the problem ...)

Any help is appreciated! thomas

EDIT: I found more details: The server seem开发者_如何转开发s to be running a VARNISH cache ... thats's the main difference to my usual configurations ... Also, the way the script works is, if you call /cgi-bin/adframe/somedir/somefile.html?x=something, $ENV{PATH_INFO} tells which template to parse and $ENV{QUERY_STRING} is, well, the query string. Now the query string is empty, but if I call /cgi-bin/adframe?x=something (without any PATH_INFO), the query string shows up! Does anyone have an idea what's going on here? thanks!


Got it. The VARNISH cache strips all the query strings off static content (*.html etc) ... phew


Just ran into the same problem. I am complete newbie in perl scripting.

I tried following:

@values = split (/&/, $ENV{'QUERY_STRING'});

but it didn`t work

this worked:

@values = split (/&/, "$ENV{'QUERY_STRING'}");

just in case if other newbies have ran into the same problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号