Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

mysql_connect() still used in 051112 update for installation


outsidethenet

Recommended Posts

Hello all.

 

I have a problem with the installation of OSC.

 

I'm running the 051112 update, PHP 5.05 under Apache 2.0.47 on FreeBSD. I think I've already passed most of the stumbling blocks with these program versions, namely:

 

- setting 'register_globals' to "On"

- setting 'register_long_arrays' to "On"

 

I can progrress to Step #2 (URL is ... /catalog/install/install.php?step=2) and enter my database details. However, when I click on "Continue" I get back a partially rendered copy of the same page. The URL does not alter.

 

In my /var/log/httpd-error.log I see the following error message:

 

PHP Fatal error: Call to undefined function mysql_connect() in /usr/local/www/plan9consulting.co.uk/catalog/includes/functions/database.php on line 19

 

Now, I know that mysql_connect has been depreciated from MySQL 5. I thought the Milestone update was meant to fix these MySQL 5 errors and use the new standard connect method? When I check the database.php file I do indeed see an old connect method:

 

} else {

$$link = mysql_connect($server, $username, $password);

}

 

I'm assuming this is why it is failing. Is there an update which includes a a database.php modified to use mysql_real_connect()?

 

In fact, having just done a quick grep under the /catalog directory I can see that `mysql_connect()` is still in use in a number of places:

 

./admin/includes/functions/database.php: $$link = mysql_connect($server, $username, $password);

 

./includes/functions/cache.php:// $conn = mysql_connect("localhost", "apachecon", "apachecon");

 

./includes/functions/database.php: $$link = mysql_connect($server, $username, $password);

 

./install/includes/functions/database.php: $$link = @mysql_connect($server, $username, $password) or $db_error = mysql_error();

 

How can this update be a fix for MySQL 5 if `mysql_connect()` is still in use within these scripts? Or am I missing something obvious?

 

Having a read of the MySQL 5 documentation it doesn't seem that using mysql_connect() is a problem per se (although it is depreciated) - more the fact that OSC doesn't call mysql_init() beforehand. As I understand it, this used to work implicitly, but now the call is required. I suspect the lack of mysql_init() is the problem here.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...