2015-02-02

We are trying to do a fresh install Zen Cart 1.5.4

When running the installer we are being given the error message 'Connection to Database failed'

Our Level 3 Tech Support spent a long time trying to solve this and reports as follows

(We should also say that we ARE able to install on a PHP5.3 server without issues)

We have double checked the database credentials being used as below by using the same credentials in a remoter MySQL client and this connects without issue

We have tried everything from changing between mysqli and mysql statements, triple checking the user/pass/database/hostname for connecting to MySQL server, to checking the error log for clues, all without having any success at getting ZenCart to connect.

When using my own test script that uses mysql_connect, there was no issue connecting, and I’m able to pull database data, as shown:

http://thesoapboxco.com/mysqltest.php

A similar test fails when using mysqli_connect:

http://thesoapboxco.com/mysqltestfail.php

This is why we had tried replacing mysqli statements in ZenCart code, but without luck getting it to work.

The error log indicates problems with PHP deprecated statements, including mysql/mysqli statements:

==========================

[Sat Jan 31 02:54:57 2015] [warn] [client 67.22.128.101] mod_fcgid: stderr: PHP Warning: mysqli_connect(): (HY000/2000): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD. This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file in /var/hsphere/local/home/soapboxco/thesoapboxco.com/mysqltestfail.php on line 14

[Sat Jan 31 02:55:10 2015] [warn] [client 67.22.128.101] mod_fcgid: stderr: PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /var/hsphere/local/home/soapboxco/thesoapboxco.com/mysqltest.php on line 14

[Sat Jan 31 02:55:10 2015] [warn] [client 67.22.128.101] mod_fcgid: stderr: PHP Deprecated: Function mysql_numrows() is deprecated in /var/hsphere/local/home/soapboxco/thesoapboxco.com/mysqltest.php on line 19

[Sat Jan 31 02:55:38 2015] [warn] [client 67.22.128.101] mod_fcgid: stderr: PHP Warning: mysqli_connect(): (HY000/2000): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD. This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file in /var/hsphere/local/home/soapboxco/thesoapboxco.com/mysqltestfail.php on line 14

[Sat Jan 31 02:55:40 2015] [warn] [client 67.22.128.101] mod_fcgid: stderr: PHP Warning: mysqli_connect(): (HY000/2000): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD. This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file in /var/hsphere/local/home/soapboxco/thesoapboxco.com/mysqltestfail.php on line 14

[Sat Jan 31 02:55:43 2015] [warn] [client 67.22.128.101] mod_fcgid: stderr: PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /var/hsphere/local/home/soapboxco/thesoapboxco.com/mysqltest.php on line 14

[Sat Jan 31 02:55:43 2015] [warn] [client 67.22.128.101] mod_fcgid: stderr: PHP Deprecated: Function mysql_numrows() is deprecated in /var/hsphere/local/home/soapboxco/thesoapboxco.com/mysqltest.php on line 19

[Sat Jan 31 02:55:45 2015] [warn] [client 67.22.128.101] mod_fcgid: stderr: PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /var/hsphere/local/home/soapboxco/thesoapboxco.com/mysqltest.php on line 14

[Sat Jan 31 02:55:45 2015] [warn] [client 67.22.128.101] mod_fcgid: stderr: PHP Deprecated: Function mysql_numrows() is deprecated in /var/hsphere/local/home/soapboxco/thesoapboxco.com/mysqltest.php on line 19

==========================

Based on this, we found the following article / posting:

==========================
http://stackoverflow.com/questions/1...ure-use-mysqli

“The entire ext/mysql PHP extension, which provides all functions named with the prefix mysql_, is officially deprecated as of PHP v5.5.0 and will be removed in the future.

It was originally introduced in PHP v2.0 for MySQL v3.23, and no new features have been added since 2006. Coupled with the lack of new features are difficulties in maintaining such old code amidst complex security vulnerabilities.

The manual has contained warnings against its use in new code since June 2011.

Coupled with the lack of new features are difficulties in maintaining such old code amidst complex security vulnerabilities."

==========================

Can you please confirm with the ZenCart developers that ZenCart is fully compliant with PHP 5.5.x, as it seems it is not?

You may need to stick with using servers that have PHP 5.3, as on web26, until the application is made compliant with PHP 5.5.×.

Please let us know if you need to migrate the ‘soapboxco’ account back to web26, and we can get that going for you, unless the developer has a way to fix the issue.

Show more