Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Install on new LAMP server PHP7 and MySQL 5


rufusking

Recommended Posts

I hope you find this helpful as I spent several hours trying to get this store up and running on a new Linux Mint server running PHP 7.0 and MySQL 5.7.16. Ill save you the boring here but you should check out the attached txt file for all the details.

 

The attached file solves the issues found with the store after you get everything ready to install.  Make sure you create your database first and then go through issues 1 and 2 before you try to install. It will save you countless time of removing the database and trying again.

osCommerce_install.txt

Link to comment
Share on other sites

Alright I found two more that were a bit more concealed. I will add them here:

 

Issue 8

If you goto a category page on the site you will see the
following text at the bottom of the product:

3065 - Expression #1 of ORDER BY clause is not in SELECT list,
references column '<site name>.p.products_date_added' which is not
in SELECT list; this is incompatible with DISTINCT

To correct the issue open the following file and lets edit it as shown
below:
-----------------------------------------------------------------------
File: ../includes/modules/new_products.php
-----------------------------------------------------------------------
Find the following code:

    $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);

replace it with:

    $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);

-----------------------------------------------------------------------
Issue 9

If you goto accoutn creation success page on the site you will see the
following text at the bottom of the product:

1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and
contains nonaggregated column '<site name>.o.date_purchased' which is
not functionally dependent on columns in GROUP BY clause; this is
incompatible with sql_mode=only_full_group_by

To correct the issue open the following file and lets edit it as shown
below:
-----------------------------------------------------------------------
File: ../includes/modules/boxes/bm_order_history.php
-----------------------------------------------------------------------
Find the following code:

        $orders_query = tep_db_query("select distinct op.products_id from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_PRODUCTS . " p where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = op.orders_id and op.products_id = p.products_id and p.products_status = '1' group by products_id order by o.date_purchased desc limit " . MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX);

replace it with:

        $orders_query = tep_db_query("select op.products_id from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_PRODUCTS . " p where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = op.orders_id and op.products_id = p.products_id and p.products_status = '1' group by products_id, o.date_purchased order by o.date_purchased desc limit " . MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX);

-----------------------------------------------------------------------

Link to comment
Share on other sites

@@rufusking thanks for taking the time addressing the issues you come across.

 

Regarding the PHP 7 deprecated notices and MySQL 5.7 query issues, the following changes will be available in v2.3.5:

 

https://github.com/osCommerce/oscommerce2/commit/5bc88b789fc7d92c7171dfc4812db21f53b33693

 

The error logging fixes the deprecated notices, and setting the sql mode to a traditional empty value fixes the query issues (this helps add-ons as well).

 

v2.4.0 introduces a strict PHP error logging and MySQL sql mode that add-ons will need to adapt to.

:heart:, osCommerce

Link to comment
Share on other sites

Thanks Harald for responding to this I have admired your work for a while.  Are you guys also addressing a few of the known vulnerabilities like XSS and httponly cookies?  From a security stand point these can have bid impacts I think.  Anyway, kudos to the team for a great product.  (Still cant wait for v3)

Link to comment
Share on other sites

Or you can avoid all of these patches by installing the Bootstrap Edge version, and be up to date as well.

 

Regards

Jim

 

Ok I reviewed the bootstrap version you referenced and with PHP7 and MySQL 5.7.16 there are still some SQL issues plus the site has the old deprecated tags still so that shows up as well.  The site uses non httponly cookies and allows for cross site scripting in some weird cases.  Plus the overall feel of this one is a bit different than the original.  I like the original layout since I can modify it easily.  Been a user of OSC for like (ahem 15 years now)

 

thanks for the insight on this version though

Link to comment
Share on other sites

@@rufusking thanks for taking the time addressing the issues you come across.

 

Regarding the PHP 7 deprecated notices and MySQL 5.7 query issues, the following changes will be available in v2.3.5:

 

https://github.com/osCommerce/oscommerce2/commit/5bc88b789fc7d92c7171dfc4812db21f53b33693

 

The error logging fixes the deprecated notices, and setting the sql mode to a traditional empty value fixes the query issues (this helps add-ons as well).

 

v2.4.0 introduces a strict PHP error logging and MySQL sql mode that add-ons will need to adapt to.

 

Deprecated kick off could be cause an unexpected blank page on higher PHP versions. There would be a redline message about it if happen in v2.3.. osc version.

 

PHP changed and osc's core flies away... update to the next version or consult with your host

 

v2.4 core uses update feature so there is no need mess.

 

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...