The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cannot access database data by using http://ip/~username

Discussion in 'General Discussion' started by qweeak, Jul 29, 2011.

  1. qweeak

    qweeak Member

    Joined:
    Jul 29, 2011
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I'm really new to cpanel.

    I know we can preview the site using http://ip/~userrname.
    Problem is that i cann't access the database data that is used in the site.
    mode_userdir is enabled.

    This there a solution for this ?
     
  2. JawadArshad

    JawadArshad Well-Known Member
    PartnerNOC

    Joined:
    Apr 8, 2008
    Messages:
    447
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    PK
    cPanel Access Level:
    DataCenter Provider
    What is the exact error you are getting and are you able to access the db data via normal access using domain name.

     
  3. ultimatehosting

    Joined:
    Jul 30, 2011
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    cPanel Access Level:
    Root Administrator
    If you're getting a error "Unable to connect to the database" you should check the database connection settings in your config file. 90% of such issues are related to incorrect database settings.
     
  4. qweeak

    qweeak Member

    Joined:
    Jul 29, 2011
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Thks for rply.. but i didn't get any error. I have a site hosted in another place which shows all the pictures and stuff from database. I'm moving to new hosting provider and want to check if my site works in the new place by previewing it as http://ip/~username. It is showing only the things that are not in database when accessing by http://ip/~username. I think u get the picture now. Is there a way to work this out ?
     
  5. JawadArshad

    JawadArshad Well-Known Member
    PartnerNOC

    Joined:
    Apr 8, 2008
    Messages:
    447
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    PK
    cPanel Access Level:
    DataCenter Provider
    If the image paths are URL linked or hard coded, then you can get broken images at times. Its no fault of cPanel, nor the code which is not designed to be viewed like this. In such a scenario, rather than the http://ip/~username, try previewing the site by its URL after pointing it to the new server IP by the hosts file first.

    http://en.wikipedia.org/wiki/Hosts_(file)

    On a windows hosts file, the syntax would be.

    Code:
    1.2.3.4 yoursite.com
    
    This will override any DNS settings and you will be able to preview the site on the new server easily. After adding this entry to your computer's hosts file, restart your browser and try loading the site through its site name and see if it works fine from the new server.

     
  6. shahjashua0

    shahjashua0 Registered

    Joined:
    Aug 4, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    go to the wikipedia and get the file that wil be used for the hosting purposes and it will help u so much
     
Loading...

Share This Page