Results 1 to 5 of 5
  1. #1
    Join Date
    May 2010
    Posts
    4

    Exclamation Unanswered: connecting to DB issue URGENT help (please)

    hey i have a project and i am trying to run some php script on my website and connect it to my home postgis db.

    I wanted to do this all locally first, but i could not get php running on my system locally.


    So pleasee...

    how do i connect to my HOME behind Verizon fios line Database.

    <?php
    $myServer = "localhost";
    $myUser = "postgres";
    $myPass = "your_password";
    $myDB = "postgis";



    if this is the standard connection for a database on a website, how would i edit it to connect to my home Desktop?

    the site im trying to connect from with the script is http://findariver.com/emergencyapp/index2.php


    User postgress
    pass blabla
    port 5432
    dbname postgis

    My host is 127.0.0.1:5432

    Computer ip is 192.168.1.2
    IPv4 DNS server 71.243.0.12 <--- not sure if this is needed.

    So how would i point the database to enter my network, and then the computer?

    I have searched online but seem to find little on this, it should be quite simple. But i just need to finish this project by tomorrow and am really stuck.



    if anyone knows please let me know asap
    Last edited by cenkaetaya; 05-10-10 at 14:59.

  2. #2
    Join Date
    May 2010
    Posts
    4
    i just went to displaymyhostname.com and it shows

    pool-108-7-60-187.bstbna.fios.verizon.net

    would i need to use this?

  3. #3
    Join Date
    Aug 2009
    Location
    Olympia, WA
    Posts
    337
    This isn't a Postgres question. Man where do I start?

    Ok, your IP addr is an internal one. No computers on the Internet can use it to reach your computer. Sign up for a service like dyndns and then you'll need a port forwarded from your router to 5432 on your box. And you need to make sure Postgres is configured to accept connections from the Internet... You really need to go back and do some more reading.

  4. #4
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    Quote Originally Posted by cenkaetaya View Post
    i just went to displaymyhostname.com and it shows

    pool-108-7-60-187.bstbna.fios.verizon.net

    would i need to use this?
    For a permanent solution, you would need the dynamic IP address forwarding, as artacus72 mentions. But, just to get it working, from the outside world (beyond your local network) you need to connect to (probably) 108.7.60.187 , assuming that your ISP doesn't switch IP addresses too often. (many dont, until your cable modem is rebooted.) And, you will need to set up port forwarding on your router, assuming that you have a router on your network, that is) to forward port 5432 to IP address 192.168.1.2 Note that if you want a more permanent solution, you'll want to manually set up your database server on a fixed IP address - not a DCHP configuration.

    Finally, you will want to configure PostgreSQL to accept connection requests via TCP/IP. Be SURE to require, at a minimum, MD5 passwords. Otherwise, you're just begging to have your PC to be hacked.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  5. #5
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    Quote Originally Posted by cenkaetaya View Post
    i just went to displaymyhostname.com and it shows

    pool-108-7-60-187.bstbna.fios.verizon.net

    would i need to use this?
    For a permanent solution, you would need the dynamic IP address forwarding, as articus mentions. But, just to get it working, from the outside world (beyond your local network) you need to connect to (probably) 108.7.60.187 , assuming that your ISP doesn't switch IP addresses too often. (many dont, until your cable modem is rebooted.) And, you will need to set up port forwarding on your router, assuming that you have a router on your network, that is) to forward port 5432 to IP address 192.168.1.2 Note that if you want a more permanent solution, you'll want to manually set up your database server on a fixed IP address - not a DCHP configuration.

    Finally, you will want to configure PostgreSQL to accept connection requests via TCP/IP. Be SURE to require, at a minimum, MD5 passwords. Otherwise, you're just begging to have your PC to be hacked.

    BTW. Most ISPs don't want you to serve data from home - it eats up more outgoing data than just browsing - so they block common server ports (port 80 (HTTP), port 1433 (SQL Server), and others. You may need to change the default pg port to something less obviously a server port number...
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


Posting Permissions

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