I'm trying to print my environment variable defined in .htaccess from PHP script in shell.
My tree is:
/.htaccess (in root folder)
/test/index.php (in "test" folder)
I set my variable in .htaccess with SetEnv:
SetEnv HTTP_TEST "testing"
My PHP script "/test/index.php" is:
#!/usr/bin/php
<?php
echo $_ENV['HTTP_TEST']; // print empty
echo $_SERVER['HTTP_TEST']; // print empty
echo getenv('HTTP_TEST'); // print empty
But if I access my PHP script from my browser there is no problems (without #!/usr/bin/php of course...)
Thank you for any help.