Setting an environment variable on an Apache HTTP server is a good approach to safely store variables and have access to them on a global scope. It is possible to set environment variables by writing the following line in a .htaccess file. This .htaccess file should be stored in the root folder of your wesbite.