I am a PHP newbie and a have a php security question. Is it possible for somebody to get the source code of a php script file running on a server with default configuration?
Well, "default configuration" is a vague term, but as long as the web server is configured to parse .php
files through PHP, you should be fine from that angle. If your scripts themselves happen to parse other PHP files (for eg. a template system) then you need to make sure there aren't any loopholes in that too, since the PHP scripts have full access to your files on the server.
Assuming these are taken care of, you don't need to keep the "sensitive" data in any special place -- just put them in your .php
files, but make sure all your scripts end in .php
(for eg. config.inc.php
) so that they are always parsed via PHP and not sent as plain text.