All pastes #799440 Raw Edit

Tomtt

public text v1 · immutable
#799440 ·published 2007-11-27 17:22 UTC
rendered paste body
I am having an issue on a shared host passing an environment variable to a cgi script. To test the behaviour I have written a cgi script that just outputs its environment variables. The relevant rewrite rule in the .htaccess file is:
RewriteRule ^test_env$ env.cgi [E=TEST:test_value]

I have the same script/.htaccess setup locally (apache 2.2.4) and remotely (apache 1.3.37). When accessing /test_env locally this creates the env REDIRECT_TEST="test_value" as expected. Remotely there is no extra env value set.

Here is a minimal .htaccess that produces the behaviour:
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI
RewriteEngine On
RewriteRule ^test_env$ env.cgi [E=TEST:test_value]

I'm at a loss to figure out where to look from here on and what I can tell my provider so this can be resolved. Any pointers welcome.

- Adding the PT flag does not help, but should not make a difference since it is the final rule
- Using env= instead of E= does not make a difference

More info on apache versions:
Remotely:
  Apache/1.3.37 (Unix) PHP/5.2.4 mod_gzip/1.3.26.1a mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a
  Loaded Modules: mod_php5, mod_gzip, mod_security, mod_bandwidth, mod_auth_passthrough, mod_log_bytes, mod_bwlimited, mod_frontpage, mod_ssl, mod_setenvif, mod_so, mod_expires, mod_auth, mod_access, mod_rewrite, mod_alias, mod_userdir, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_status, mod_negotiation, mod_mime, mod_log_config, mod_env, http_core

Locally:
  Apache/2.2.4 (Ubuntu) PHP/5.2.3-1ubuntu6
  Loaded modules: core mod_log_config mod_logio prefork http_core mod_so mod_alias mod_auth_basic mod_authn_file mod_authz_default mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_dir mod_env mod_mime mod_negotiation mod_php5 mod_rewrite mod_setenvif mod_status mod_userdir