views:

25

answers:

2

I have created a file called config.php and it is as under

<?php
$dbUser="test";
$dbPassword="123456";
$dbName="testDatabase";
$dbHost="localhost";
$dbPort="3306";
$tablePrefix="test_";
?>

Now i have set permissions of this file to 744, so that i can make connection any time i need. but what would happen if anyone else will try to read this file and make connection to my database server as a dbuser. this would be problematic for me.
So what should be done?? or what permissions should be given so that my web server will be able to read the file but anyone else who tries to read should not be able to read the file.
Thanks in advance.

+1  A: 

If you have your own web-server, running under your own user, you can make it 600.

But usually you don't have to worry about it, because your shared hosting provider taking care of it, making different hosting users unable to access each other's files.

Col. Shrapnel
A: 

When you have a file like config.php you don't have to worry about other people who can access it. First of all people can't read the php code inside your document so you dont have to edit the permissions of the file.

Leave it as default.

Jordy