Jump to content

Dreaded "database Server Is Not Found."


Recommended Posts

First installation.

Current version.

Port is okay.

All server requirements are met.

 

I get  "Database Server is not found."

 

I have a small program that connected to the database okay with the credentials.

Database has a test table.

The program read a test table fields okay, too.

 

Now what?

Edited by iambwe (see edit history)
Link to comment
Share on other sites

Okay dudes,

 

You have an error in your program, Db.php

This returns the wrong class.

It is returning "DbPDO" when it should be "DbMySQLi".

 

    public static function getClass()
    {
        $class = 'MySQL';
        if (PHP_VERSION_ID >= 50200 && extension_loaded('pdo_mysql')) {
            $class = 'DbPDO';
        } elseif (extension_loaded('mysqli')) {
            $class = 'DbMySQLi';
        }
        return $class;
    }

 

I overrode your return $class: to return "DbMySQLi";

 

BTW - I am on PHP ver 5.5.30 & pdo_mysql is loaded.

BUT, mysqlnd ver is

   mysqlnd 5.0.11-dev - 20120503 - $Id: 15d5c781cfcad91193dceae1d2cdd127674ddb3e $

Edited by iambwe (see edit history)
Link to comment
Share on other sites

I am not following this. 

 

You state you have the 'pdo_mysql' extension installed and loaded, then the Prestashop class that should be used is 'DbPDO'

 

Why are you saying there is an error in Prestashop and that the DbMySQLi class should be used for PDO?

Link to comment
Share on other sites

I am not following this. 

 

You state you have the 'pdo_mysql' extension installed and loaded, then the Prestashop class that should be used is 'DbPDO'

 

Why are you saying there is an error in Prestashop and that the DbMySQLi class should be used for PDO?

 

In my case, DbMySQLi should be used. I don't know about everyone else. The program was returning the wrong class, so I overrode it until the program can be fixed. I do not know the proper way to fix it otherwise I'd submit it on github.

 

The class, "DbPDO" was returned at first - that did not work. So I hardcoded that snippet to return "DbMySQLi".

 

Read my post:

 

BTW - I am on PHP ver 5.5.30 & pdo_mysql is loaded.

BUT, mysqlnd ver is

   mysqlnd 5.0.11-dev - 20120503 - $Id: 15d5c781cfcad91193dceae1d2cdd127674ddb3e $

 

Perhaps the program means mysqlnd version, not the website php version? I don't know how to fix this for everyone but got it fixed for me.

 

BTW - So far I love this program after eons of testing and trying other lame ecommerce solutions that are highly customizable.

Edited by iambwe (see edit history)
Link to comment
Share on other sites

I read your post.  Using DbMySQLi is NOT correct.  If you have the PDO extension really installed and loaded, then you should be using the DbPDO class. 

 

What you should be doing is removing the PDO extension from your PHP, because it is obviously not installed properly.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...