Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Problem with new installation of OSC 2.3.4BS


sanctuarybookshop

Recommended Posts

I've just installed OSC 2.3.4BS on a linux machine running Ubutntu 16.04 with Apache 2, Mysql 5.7 and PHP 7.0.

 

The installation went flawlessly but when try to access either frontend or the admin pages I'm presented with a blank page in Firefox and in Chromium-Browser get HTTP 500 error.

 

Any suggestions?

 

Link to comment
Share on other sites

@@sanctuarybookshop I don't think Gold will run on php7 so if you installed that version that might explain the problem.  It is my understanding that Edge has been modified to run on php7 though.

 

Dan 

Link to comment
Share on other sites

I should be able to downgrade to PHP 5 hopefully. I tried the non BS version and the admin side is working fine, but the front end gives the following output :-

 

3065 - Expression #1 of ORDER BY clause is not in SELECT list, references column 'remotorvate2.p.products_ordered' which is not in SELECT list; this is incompatible with DISTINCT

select distinct p.products_id, pd.products_name from products p, products_description pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '1' order by p.products_ordered desc, pd.products_name limit 10

[TEP STOP]

 

Maybe that is a PHP 7 issue as well?

Link to comment
Share on other sites

Now back up to PHP7.0 the Gold and Edge versions both giving HTTP 500 error but standard version brings up the install screen albeit with the "mysql The MySQL extension is required but is not installed. Please enable it to continue installation." error.

 

Could it be that need to downgrade mysql too?

Link to comment
Share on other sites

It sounds like you somehow lost the MySQLi (or MySQL) extension in PHP when you returned to PHP 7. Double check your work (and run phpinfo(); ). Either version of 2.3.4BS should run fine in PHP 5.6, but you probably need Edge to use PHP 7.

 

The error message you posted in #4 sounds like it's strictly a MySQL error (nothing to do with PHP) -- could you possibly be using a back-level MySQL installation? Or, is MySQL 5.7 so bleeding edge that it requires a fix to osC code? I think 5.7 has been out for a while, and Edge should work with it. Note that the MySQLi library, rather than MySQL, is preferred for MySQL DB usage, and may even be required by osC.

 

Your problems with switching back and forth on PHP versions leads me to ask: Is this on a commercial server, or are you trying to save a few dollars by running your own PC server? If the latter, that's a bad idea. Hackers know far more about security issues than you do, and will eat you alive. There are only two justifications for running your own local server: 1) you don't yet have a commercial server account, and want to play with an application before committing to it, and 2) your host doesn't offer a server level (Apache, PHP, MySQL versions) that you need to test and develop on. Either way, you should never be running a live server (exposed to the public) on your own PC. It's false economy.

Link to comment
Share on other sites

this is output from php info relating to MySQL and MySQLi :-

 

mysqli MysqlI Support enabled Client API library version mysqlnd 5.0.12-dev - 20150407 - $Id: 241ae00989d1995ffcbbf63d579943635faf9972 $ Active Persistent Links 0 Inactive Persistent Links 0 Active Links 0 Directive Local Value Master Value mysqli.allow_local_infile On On mysqli.allow_persistent On On mysqli.default_host no value no value mysqli.default_port 3306 3306 mysqli.default_pw no value no value mysqli.default_socket no value no value mysqli.default_user no value no value mysqli.max_links Unlimited Unlimited mysqli.max_persistent Unlimited Unlimited mysqli.reconnect Off Off mysqli.rollback_on_cached_plink Off Off mysqlnd mysqlnd enabled Version mysqlnd 5.0.12-dev - 20150407 - $Id: 241ae00989d1995ffcbbf63d579943635faf9972 $ Compression supported core SSL supported extended SSL supported Command buffer size 4096 Read buffer size 32768 Read timeout 31536000 Collecting statistics Yes Collecting memory statistics No Tracing n/a Loaded plugins mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password,auth_plugin_sha256_password API Extensions mysqli,pdo_mysql

 

Link to comment
Share on other sites

Please use "code" tags around output like that, so it isn't all run together.

 

It sounds like MySQLi (and presumably, MySQL) libraries are enabled. However, there are a lot of entries which have no default values, and you may have to be careful to give explicit values for all these things. Just some of the misery of trying to run your own server. If you have a commercial server account, it's often better to use a private "test" directory on it (for non-public material) than to try setting up a PC-based server. You won't have to make a bunch of code and setting changes when you move it over to production (due to different PHP etc. versions). Of course, if your host doesn't offer the PHP etc. version you need...

Link to comment
Share on other sites

  • 1 month later...

I'm a  little late to the party here I think but the issue is with the code located in bm_best_sellers.php. 

File Location:: /includes/modules/boxes/bm_best_sellers.php

 

You can resolve the issue by finding the following

 

        if (isset($current_category_id) && ($current_category_id > 0)) {
          $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id) order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
        } else {
          $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
        }

 

and replacing it with this:

 

        if (isset($current_category_id) && ($current_category_id > 0)) {
          $best_sellers_query = tep_db_query("select p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id) order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
        } else {
          $best_sellers_query = tep_db_query("select p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
        }

 

from that point the page will display without the warning message.

 

Note you may see this issue again in the file : /includes/modules/new_products.php as this code is similar It is not affecting the store on my side at this time however I do expect it to so I will be changing that from:

 

  if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
    $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
  } else {
    $new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
  }

 

to:

 

  if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
    $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
  } else {
    $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
  }

3065 - Expression #1.txt

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...