Reputation: 11
So I'm storing my MySQL database connection login info in a .php file that's above the web root.
But if someone gains access to the whole server, they could potentially open that file up
What else can I do to protect the info?
Upvotes: 1
Views: 163
Reputation: 490547
Besides the obvious answers, you should ensure your site is safe from directory traversal attacks that may read your PHP file above the root.
echo file_get_contents($_GET['page']);
(better example than previous)
Upvotes: 2
Reputation: 12323
If someone has access to your entire production webserver, I figure you would have bigger issues than hiding your MySQL database credentials.
Upvotes: 5
Reputation: 255085
You cannot do anything against the person who got the access to the server.
Upvotes: 2