PHP default host best practices

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • esingley@gmail.com

    PHP default host best practices

    I've got my dev and production environments all setup, and the mysql
    DBs working fine. What need to do is set the mysql.default_h ost option
    in php.ini to be one thing on dev, and something different on
    production. Unfortunately, my web host doesn't allow me to mess with
    php.ini.

    So, what's the best way to specify a different host to mysql_connect()
    on dev and production. Yes, I could manually edit the variable
    everything I FTP, but I'd rather not.

    Should I use a global variable in a separate include file? Other
    options?

    Thanks.

  • Peter van Schie

    #2
    Re: PHP default host best practices

    esingley@gmail. com wrote:
    [color=blue]
    > So, what's the best way to specify a different host to mysql_connect()
    > on dev and production. Yes, I could manually edit the variable
    > everything I FTP, but I'd rather not.
    >
    > Should I use a global variable in a separate include file? Other
    > options?[/color]

    I usually use an include file in which I define this type of settings.
    In case of the database host it's usually localhost though, unless you
    run the database server on a seperate server.

    HTH.
    Peter.

    --


    Comment

    Working...