Set environment variable

Avatar
  • updated
  • Answered

Is there a way to get an environment variable set for my sites? SendGrid recommends I use an environment variable to store the API key and then retrieve with a getenv call in my PHP code.

Avatar
IMH Support Agent 2
  • Answered

Hello Mike,

Thanks for the question about setting the environment variable in cPanel (which uses centOS).  First, if you're not an experienced developer/programmer that is familiar with how making this kind of change may affect your server, then I highly recommend that you consult with an expert.  The documentation link that I'm sharing warns you to proceed with caution.  This documentation is from cPanel:  Environmental Variables. The warning at the top of the page is about the version of EasyApache. Our servers are updated to EasyApache 4.  You will not be able to do this on a shared server.  These instructions only apply to a VPS or dedicated server using Root access.


If you have any further questions or comments, please let us know.


Kindest regards,

Arnel C.