Jump to content

Using custom environment variables for DB conn


h20boynz

Recommended Posts

What I have done in the past is created a conn.php file, used as an include, when I wish to connect to my DB.

As a security measure, rather than have my connection info in a file that could potentially get accessed by unauthorised users, I read that I could use environment variables and store the database connection string values i.e username, password etc for retrieval.

 

Can anyone offer some guidance on going about this?

 

Thanks

 

have my connection info in a file that could potentially get accessed by unauthorized users

 

If someone has direct access to the contents of your files on the server, they would also have direct access to any other method you are using to define the database connection details.

 

What makes you think that putting your connection information in a file is not secure?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.