Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Junior Member Dan Williams's Avatar
    Join Date
    Jun 2012
    Posts
    8
    Member #
    32032
    Liked
    2 times
    I am a little embarassed that I can't figure this out on my own. I am trying to install a template theme on an osCommerce site. I upload the files, set up the database but I am still getting an error message when I visit the domain after the installation process.

    The error message is as follows:

    Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/No-MySQL-hostname-was-specified' (2) in /home/guitarpickers/guitarpickersaz.com/includes/functions/database.php on line 19
    Unable to connect to database server!

    When I look at the PHP file, things look like they should be correct.
    This is a screen shot of the code I have that is not responding correctly:


    And here is a screen shot of the original code before the setup:


    Now, I have tried to figure out where in the process things go wrong, but can't seem to find it. I understand the basic process and how it should work, but something weird is happening.

    I have installed a fresh copy of osCommerce without a theme and the setup works perfectly, the database works, and the store looks functional. However, when I go through the same process while uploading the template version, it will not work. It gets hung up on that error message.

    It says there is an error on line 19 of that file, but it doesn't seem like there is to me. Why won't this connect to the server? Any help and advice would be so greatly appreciated! Let me know if you need any other info or if I left anything out.

  2.  

  3. #2
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    Not sure a out the newer version of this, but the older version for templating, you uploaded the template into the templates folder ( via FTP ), the inside the admin section, you select the new template. Then when the site is called, the new template is used.

    The PHP config files should only be adjusted if you know what you're doing.

    Don't know if this will help, but the last time I worked with os commerce, my client paid for a custom template, I just uploaded it, then pointed to it in the admin section.

  4. #3
    Junior Member Dan Williams's Avatar
    Join Date
    Jun 2012
    Posts
    8
    Member #
    32032
    Liked
    2 times
    I wish it was that simple, Webzarus. That would make entirely too much sense though. haha. They love to make things complicated. Through my searching for answers it seems like, although overly complicated, it shouldn't be as tough as it was for me. I boil it down to a bad template. It would be easier if they used a Wordpress type process where you just load the template and select it in the admin section.

    The way it should be handled is just overwriting the files (via FTP) and then entering in the database info. Easy breezy. But for me, the template the client chose overwrote the wrong files with the wrong info.

    In my case, changing the functions/database.php file and the config file was my only option.

    Just in case anyone else searching needs to know what steps I took, here is what I did:

    When I loaded the template, it threw the info into the function file located at includes/functions/database.php. I don't think this is what should normally happen, but that's what MY template did.
    I changed the function file back to the orginal info. In the above screen shots, you can see each.

    It set the function file as:
    ($guitarpickers, $guitarpickers, $Nottherealpassword)

    and I changed it back to:
    ($server, $username, $password)

    From there I had a bunch of weird info in my includes/configure.php file.

    I had to alter lines 2 and 3 to:

    define('HTTP_SERVER', 'http://guitarpickersaz.com');
    define('HTTPS_SERVER', 'http://guitarpickersaz.com');

    Along with line 21

    define('DIR_FS_CATALOG', 'http://guitarpickersaz.com');

    And lines 25,26,27,28

    define('DB_SERVER', 'mysql.guitarpickersaz.com');
    define('DB_SERVER_USERNAME', 'guitarpickersdb');
    define('DB_SERVER_PASSWORD', 'Nottherealpassword');
    define('DB_DATABASE', 'guitarpickersdb');

    Once I uploaded these changes, the site pulls up and functions properly. There seem to still be a few bugs on the template itself, but the site is pulling up the way it should.

    I think this was just a bad template, honestly, but this was my fix.

    Hope my error ends up helping somebody else out.

    And thank you, Web, for trying to help me out. Much appreciated.
    AlphaMare likes this.

  5. #4
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    And thanks, Dan, for posting your fix. Quite often we get posts like "Never mind, fixed it!" and those are of no help to anyone. So thanks for taking the time to post the fix and the steps - it may well help someone out down the road!
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 02:30 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com