Wordpress
Author
Discussion

doc brown

Original Poster:

937 posts

249 months

Tuesday 9th October 2007
quotequote all
First of all, let me get this point across. I DO NOT KNOW WHAT I AM DOING. All this PHP/MySQL is new to me and i'm learning as I go along.

OK, I've install wordpress on my webhost. I'm impressed with 'The Learners' homepage and thought i'd have a go. The install seems to be fine, but i'm a bit concerned over 1 thing so far.

I had to modify the wp-config.php file to contain my MySQL DB details, i'm happy enough with this, and it all seems great, but whats to stop someone taking a copy of that file and ripping out the username and password from it? And wouldnt they then have access to my MYSQL Database.

I'm pretty happy with my progress so far, and i may also look into installing Gallery 2 as well...if my confidence stays high.


onomatopoeia

3,526 posts

248 months

Tuesday 9th October 2007
quotequote all
Without knowing anything about wordpress, I'd assume that the part of the wp-config.php file that contains the sensitive information does not get sent to the client when it is opened from a browser, the only way to get the complete file would be via FTP or similar. php is "executed" within the http server to produce the output that the browser gets, the entire source file is not sent down when you request a php page in explorer / firefox etc.

That assumes you have the php module installed in apache on your server, if you don't then php files will be sent complete as a file you can download just like any other "unknown" file type, rather than run through the php interpreter first.

Or more simply, put some duff password information in, upload the file and try it. If you look at the source of what you get back I'm pretty sure the duff password you supplied wont be there.

doc brown

Original Poster:

937 posts

249 months

Tuesday 9th October 2007
quotequote all
onomatopoeia said:
php is "executed" within the http server to produce the output that the browser gets, the entire source file is not sent down when you request a php page in explorer / firefox etc.
Ahhh! That makes sense....See, i'm learning all the time.

Thanks for the reply, Day off tomorrow so i'm going to have a play around with Gallery 2 as well.

slapmatt

1,132 posts

253 months

Tuesday 9th October 2007
quotequote all
Check the documentation, but I think you are supposed to change the permissions on the config file so that it cannot be accessed via the Web.