Re: Best practice regarding MySQL username/pw in script file??



dimo414 wrote:
I agree with the suggestion to keep username/password files outside the
web root. If you cannot do this (such as scripts like PHPBB and
Coppermine) place the username/passwords inside a PHP file as varibles
which can be included in any needed scripts, this way, if someone knows
the name of the password file, and tries to view it, all they will see
is a blank screen, as the PHP was parsed and dealt with before being
sent out.


You can move the file outside the web-root too, move the file to a secure location, create a new file with the same name in the same location and you just add the include_once/include line to include the original configuration file, this works fine as long as there aren't any include lines in the original file, if there are, you need to change those to include an absolute path to the included files instead of relative paths.


//Aho
.



Relevant Pages

  • Re: Best practice regarding MySQL username/pw in script file??
    ... Coppermine) place the username/passwords inside a PHP file as varibles ... which can be included in any needed scripts, this way, if someone knows ... just add the include_once/include line to include the original configuration ... path to the included files instead of relative paths. ...
    (alt.php)
  • Re: [slrn] Changing macro installation path?
    ... Where do most store these macros for easy access and editing. ... Which compile option controls the directory for these? ... You could set an absolute path to your scripts. ...
    (news.software.readers)
  • Re: Relative path
    ... >>Now how can I enable my scripts to deal with relative pathnames? ... >>etc.) the files if I do not specify an absolute path. ... I always hesitate to use perldoc, since the system is so crippled on my machine. ... rel2abs and abs2rel are not mentioned in either Perl in a Nutshell or Programming Perl. ...
    (perl.beginners)
  • Re: sourceing files in multiple places - why bad?
    ... I'd make sure you use absolute path names with ... change directories and source commonly-named files in the relative path ... You still run the risk of breaking something if any of your scripts ... uses to manage mountpoints, or, for that matter, rename script files. ...
    (comp.lang.tcl)
  • Re: Database password security
    ... No one is able to call scripts out of context, ... strange results and error messages. ... >because apache will parse the php file before it is sent. ... "forgets" to parse a file. ...
    (comp.lang.php)