Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jan 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    remote connection help!

    hi, does anybody know how to connect php app to remote servers?
    Ive tried to connect wp to an external database but i dont know how, well... i completed all the connection information as you see below:

    define('DB_NAME', ''); // The name of the database
    define('DB_USER', ''); // Your MySQL username
    define('DB_PASSWORD', ''); // ...and password
    define('DB_HOST', ''); // 99% chance you won't need to change this value

    but in db_host I wrote the host only because I dont know the port.

    Thanks for helping

    Ps I allowed the server in cpanel to grant host access!
    The connection is from WIN2003 to unix

  • #2
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You would use the domain name.
    Have you checked that the host/server allows remote connections?

  • #3
    New to the CF scene
    Join Date
    Jan 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks degsy but how can i do it?

  • #4
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ask the server admin if they allow remote connections

  • #5
    Registered User
    Join Date
    Sep 2005
    Posts
    315
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i also did this once, and all i had to do is insert into DB_HOST 'sitename.extension'

  • #6
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    My WP database is set to a different hosting. This is what I did -

    define('DB_HOST', 'db189.oneandone.co.uk');

    I can't remember where I got the host name from (using 1and1), but check out your hosting settings and I'm sure it'll say there what to put.

  • #7
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    define('DB_HOST', '192.168.0.1:3306');

    3306 is the default mysql port but check your phpinfo() output to be sure
    if you are unsure of the ip (you can just use the hostname of course) then ping it run >> cmd >> ping hostname
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •