Forum Moderators: coopster

Message Too Old, No Replies

Secure Database Connection

         

d40sithui

3:35 pm on Jun 29, 2007 (gmt 0)

10+ Year Member



Hello,

Can anyone share their methods for making a secure mysql connection via a PHP script or scripts...I guess what im trying to ask is how to secure the username, password, etc when connecting to the database. Any help would be appreciated!

-khanh

bcolflesh

3:43 pm on Jun 29, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



[php.net...]

henry0

4:58 pm on Jun 29, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



An important step is to move your connection script away from root.

for example:
require_once("/var/www/conn_db/db_fns.php");

where db_fns is the conn function.

VS /var/www/html/conn_db etc...
which could be easy to access.

d40sithui

6:05 pm on Jun 29, 2007 (gmt 0)

10+ Year Member



hey thanks guys for the help. i've been doing something like that for a while now. i wasnt sure if that was secure enough. i'm currently working on a different server now. the server that i worked on before i could chmod my script as 600 (or rw-------) and i could still use the include function for it. however, on the new server i cant include anthing that is less than 644 (rw-r--r--). if i do, it will give me an error. seems like a server issue. does anyone know how to fix that?