Setting Environment Variables for Accessing in PHP When Using Apache

Setting environment variables for accessing in PHP when using Apache

Something along the lines:

<VirtualHost hostname:80>
...
SetEnv VARIABLE_NAME variable_value
...
</VirtualHost>

Unable To Set Environmental Variables in Apache

So it turns out that I had set up an auto-renewing SSL certificate when I set up this server. I am new to all this web development, so I just figured EVERYTHING went into the httpd.conf file when it came to Apache. Boy was I wrong. When I created this certificate, about a dozen other config files were set up. I went through them one by one and eventually found one named httpd-le-ssl.conf. In this config, there was a VirtualHost setup listening to 443. I put my environmental variables in there and, voila, it worked!

Thanks for the suggestions!



Related Topics



Leave a reply



Submit