SOLVED I can create environment variables to share with all accounts in PHP

Ramon Pego

Well-Known Member
Mar 12, 2019
62
11
8
Brazil
cPanel Access Level
Root Administrator
Twitter
Hello, we went through a problem here where we have information saved in the .env of about 100 accounts on the server.
Until then, it was only necessary to fill it out when creating the account, now that we need to change this information in everyone who saw the problem.

We use Laravel and in .env are stored sensitive information, but there are some keys that are used by all accounts. I would like to know if it is possible for me to create some environment variable in PHP on WHM and read this variable in all accounts within .env
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
14,378
2,253
363
cPanel Access Level
Root Administrator
Hey there! While I'm not a PHP developer, or really any type of developer, this seems like the best option:


You could do this with the cPanel Apache Include system as outlined here: Advanced Apache Configuration | cPanel & WHM Documentation
 

Ramon Pego

Well-Known Member
Mar 12, 2019
62
11
8
Brazil
cPanel Access Level
Root Administrator
Twitter
Hello sorry for the delay, we went on holiday here in Brazil. But that is exactly what I needed.
I still had to go to each one to put these environment variables on each client. But it's a job that I won't have to redo
This is great, thank you very much.
This will save us a lot.

you can mark as solved