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

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.