Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

php 7.2 - updating CE


Recommended Posts

I've a little bit of time in hand and it seems like this is the next necessary thing to solve, the use of php7.2.  But I need your help to point out any problematic area so that attention can be given to them.

To help...you'll need an installation of CE (any flavour that is Frozen or later) running on php 7.2 - with error reporting dialled right up.  To set up error_reporting to show everything that is wrong:

includes/application_top.php

  • Find:

    error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT);
     
  • Change to:

    ini_set('display_errors', 1);
    ini_set('display_startup_errors', 1);
    error_reporting(E_ALL);

admin/includes/application_top.php

  • Find:

    error_reporting(E_ALL & ~E_NOTICE);

    if (defined('E_DEPRECATED')) {
      error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
    }
     
  • Change to:

    ini_set('display_errors', 1);
    ini_set('display_startup_errors', 1);
    error_reporting(E_ALL);

Save both files.  Obviously...you DO NOT want to do this on a live shop as it will show errors to your customers, so hopefully a few people have a test shop to play with...

Now if you browse your test shop...all warning and errors will appear. 

Thank you in advance.

Please copy/paste the following as a reply:

URL: 
WARNING/ERROR:

Link to comment
Share on other sites

URL: 
shopping_cart.php (with at least 1 product)

WARNING: 
Notice: Constant TABLE_HEADING_QUANTITY already defined in \includes\languages\english\shopping_cart.php on line 29
Notice: Constant TABLE_HEADING_PRICE already defined in \includes\languages\english\shopping_cart.php on line 31

Link to comment
Share on other sites

10 minutes ago, burt said:

I've a little bit of time in hand and it seems like this is the next necessary thing to solve, the use of php7.2.  But I need your help to point out any problematic area so that attention can be given to them.

To help...you'll need an installation of CE (any flavour that is Frozen or later) running on php 7.2 - with error reporting dialled right up.  To set up error_reporting to show everything that is wrong:

Maybe set up to have errors output to a file, so that even the owners of live shops can help as well?

Eddy

Link to comment
Share on other sites

In general, it's considered bad to display errors to the public, as that can give hackers valuable information. Sending detailed errors to a log file would be good, with maybe just a generic "sorry, something went sideways" message to the public. Now, how can you capture error output (to stdout, I presume, which gets folded into the page) if such a thing can happen just about anywhere? Do error messages have a distinctive "look" to them, so that if you could capture all output to a string,  and before releasing that string ("print") to the browser, look through it for error messages and remove them? Offhand, I'm not sure how that could be done, at least across a wide range of servers.

Link to comment
Share on other sites

PHP allows all error's to be sent to a error_log file, but you need to edit your php.ini file to do this.

Most people will not have access to the php.ini file so it's simlply best to ask your host to turn on error logging for your site.

Then simlpy check your error_log file for any errors beeing logged.

If you feel upto it and have access to your php.ini then this blog shows you how to do it.

https://www.cyberciti.biz/tips/php-howto-turn-on-error-log-file.html

 

Link to comment
Share on other sites

Hi Gary,

Could you please post a download link of the preferable version to test with?
I've been running with php7.2 for quite a while, so might be of assistance here.
Unfortunatly I work with no stock versions, so comparing will not be as simple, but could set up a testshop too.
 

Link to comment
Share on other sites

PHP 7.2.12

In admin:

/admin/paypal.php

Warning: Use of undefined constant OSCOM_APP_PAYPAL_GATEWAY - assumed 'OSCOM_APP_PAYPAL_GATEWAY' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\SHOP_TEST\includes\apps\paypal\modules\DP\DP.php on line 35

Warning: Use of undefined constant OSCOM_APP_PAYPAL_GATEWAY - assumed 'OSCOM_APP_PAYPAL_GATEWAY' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\SHOP_TEST\includes\apps\paypal\modules\DP\DP.php on line 37

Warning: Use of undefined constant OSCOM_APP_PAYPAL_GATEWAY - assumed 'OSCOM_APP_PAYPAL_GATEWAY' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\SHOP_TEST\includes\apps\paypal\modules\EC\EC.php on line 35

Warning: Use of undefined constant OSCOM_APP_PAYPAL_GATEWAY - assumed 'OSCOM_APP_PAYPAL_GATEWAY' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\SHOP_TEST\includes\apps\paypal\modules\EC\EC.php on line 37

Warning: Use of undefined constant OSCOM_APP_PAYPAL_GATEWAY - assumed 'OSCOM_APP_PAYPAL_GATEWAY' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\SHOP_TEST\includes\apps\paypal\modules\HS\HS.php on line 34

Warning: Use of undefined constant OSCOM_APP_PAYPAL_GATEWAY - assumed 'OSCOM_APP_PAYPAL_GATEWAY' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\SHOP_TEST\includes\apps\paypal\modules\HS\HS.php on line 36

Link to comment
Share on other sites

Admin/index.php Dashboard:

Warning: constant(): Couldn't find constant OSCOM_APP_PAYPAL_LIVE_API_USERNAME in C:\xampp\htdocs\SHOP_TEST\includes\apps\paypal\OSCOM_PayPal.php on line 285

Warning: constant(): Couldn't find constant OSCOM_APP_PAYPAL_SANDBOX_API_USERNAME in C:\xampp\htdocs\SHOP_TEST\includes\apps\paypal\OSCOM_PayPal.php on line 288

By the way I am running local on Xammp.

Link to comment
Share on other sites

Live shop so just quoting from the error log. This is the most commonly reported warning.

[01-Mar-2019 17:30:17 UTC] PHP Warning:  Illegal string offset 'iso_code_2' in /home/xxx/public_html/includes/modules/shipping/zones.php on line 121

Link to comment
Share on other sites

Installation Errors:

Localhost under Windows 10 XAMPP PHP 7.2.9.

NOTE: Duplicated errors have been removed.

 

http://localhost/2019_03_03_2.3.4.1._EDGE_BS4/install/install.php

Notice: Undefined index: DB_SERVER in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\install\includes\functions\html_output.php on line 16

Notice: Undefined variable: _SESSION in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\install\includes\functions\html_output.php on line 16

Notice: Undefined index: DB_SERVER_USERNAME in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\install\includes\functions\html_output.php on line 16

Notice: Undefined index: DB_SERVER_PASSWORD in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\install\includes\functions\html_output.php on line 16

Notice: Undefined index: DB_DATABASE in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\install\includes\functions\html_output.php on line 16

 

http://localhost/2019_03_03_2.3.4.1._EDGE_BS4/install/install.php?step=2

Notice: Undefined index: HTTP_WWW_ADDRESS in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\install\includes\functions\html_output.php on line 16

Notice: Undefined variable: _SESSION in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\install\includes\functions\html_output.php on line 16

Notice: Undefined index: DIR_FS_DOCUMENT_ROOT in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\install\includes\functions\html_output.php on line 16

 

http://localhost/2019_03_03_2.3.4.1._EDGE_BS4/install/install.php?step=3

Notice: Undefined index: CFG_STORE_NAME in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\install\includes\functions\html_output.php on line 16

Notice: Undefined variable: _SESSION in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\install\includes\functions\html_output.php on line 16

Notice: Undefined index: CFG_STORE_OWNER_NAME in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\install\includes\functions\html_output.php on line 16

Notice: Undefined index: CFG_STORE_OWNER_EMAIL_ADDRESS in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\install\includes\functions\html_output.php on line 16

Notice: Undefined index: CFG_ADMINISTRATOR_USERNAME in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\install\includes\functions\html_output.php on line 16

Notice: Undefined index: CFG_ADMINISTRATOR_PASSWORD in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\install\includes\functions\html_output.php on line 16

Notice: Undefined index: CFG_ADMIN_DIRECTORY in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\install\includes\functions\html_output.php on line 16

Link to comment
Share on other sites

Admin side:

http://localhost/2019_03_03_2.3.4.1._EDGE_BS4/admin/modules_content.php?module=cm_in_card_products&action=edit

When installed: New Products [index_nested] content module.

Notice: Constant MODULE_CONTENT_IN_CARD_PRODUCTS_STATUS already defined in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\admin\includes\application_top.php on line 70

Notice: Constant MODULE_CONTENT_IN_CARD_PRODUCTS_CONTENT_WIDTH already defined in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\admin\includes\application_top.php on line 70

Notice: Constant MODULE_CONTENT_IN_CARD_PRODUCTS_MAX_DISPLAY already defined in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\admin\includes\application_top.php on line 70

Notice: Constant MODULE_CONTENT_IN_CARD_PRODUCTS_DISPLAY_ROW_SM already defined in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\admin\includes\application_top.php on line 70

Notice: Constant MODULE_CONTENT_IN_CARD_PRODUCTS_DISPLAY_ROW_MD already defined in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\admin\includes\application_top.php on line 70

Notice: Constant MODULE_CONTENT_IN_CARD_PRODUCTS_DISPLAY_ROW_LG already defined in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\admin\includes\application_top.php on line 70

Notice: Constant MODULE_CONTENT_IN_CARD_PRODUCTS_DISPLAY_ROW_XL already defined in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\admin\includes\application_top.php on line 70

Notice: Constant MODULE_CONTENT_IN_CARD_PRODUCTS_BUTTON already defined in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\admin\includes\application_top.php on line 70

Notice: Constant MODULE_CONTENT_IN_CARD_PRODUCTS_SORT_ORDER already defined in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\admin\includes\application_top.php on line 70

 

 

 

http://localhost/2019_03_03_2.3.4.1._EDGE_BS4/admin/modules.php?set=payment&module=braintree_cc

When installed shows:

Notice: Undefined offset: 1 in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\includes\modules\payment\braintree_cc.php on line 883

 

 

 

includes/languages/english/modules/payment/sofortueberweisung_direct.php
language file needs update to UTF-8 encoding. It shows: Sofortberweisung Direkt

When installed sofortueberweisung_direct.php on store side:

http://localhost/2019_03_03_2.3.4.1._EDGE_BS4/checkout_payment.php

Sofort�berweisung ist der kostenlose, T�V-zertifizierte Zahlungsdienst der Payment Network AG. Ihre Vorteile: keine zus�tzliche Registrierung, automatische Abbuchung von Ihrem Online-Bankkonto, h�chste Sicherheitsstandards und sofortiger Versand von Lagerware. F�r die Bezahlung mit Sofort�berweisung ben�tigen Sie Ihre eBanking Zugangsdaten, d.h. Bankverbindung, Kontonummer, PIN und TAN.

Notice: Undefined index: field in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\checkout_payment.php on line 205

 

 

Link to comment
Share on other sites

Store side: index page, all content modules and boxes installed:


http://localhost/2019_03_03_2.3.4.1._EDGE_BS4/login.php
Warning: Use of undefined constant MODULE_BOXES_INFORMATION_BOX_DATA - assumed 'MODULE_BOXES_INFORMATION_BOX_DATA' (this will throw an Error in a future version of PHP) in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\includes\modules\boxes\bm_information.php on line 37

Warning: Invalid argument supplied for foreach() in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\includes\modules\boxes\bm_information.php on line 37

http://localhost/2019_03_03_2.3.4.1._EDGE_BS4/index.php
Warning: Use of undefined constant MODULE_CONTENT_CARD_PRODUCTS_TITLE - assumed 'MODULE_CONTENT_CARD_PRODUCTS_TITLE' (this will throw an Error in a future version of PHP) in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\includes\modules\content\index\cm_i_card_products.php on line 29

Warning: Use of undefined constant MODULE_CONTENT_CARD_PRODUCTS_DESCRIPTION - assumed 'MODULE_CONTENT_CARD_PRODUCTS_DESCRIPTION' (this will throw an Error in a future version of PHP) in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\includes\modules\content\index\cm_i_card_products.php on line 30
Warning: Use of undefined constant MODULE_CONTENT_CARD_PRODUCTS_HEADING - assumed 'MODULE_CONTENT_CARD_PRODUCTS_HEADING' (this will throw an Error in a future version of PHP) in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\includes\modules\content\index\templates\tpl_cm_i_card_products.php on line 2
MODULE_CONTENT_CARD_PRODUCTS_HEADING

Warning: Use of undefined constant MODULE_CONTENT_CARD_PRODUCTS_BUTTON_VIEW - assumed 'MODULE_CONTENT_CARD_PRODUCTS_BUTTON_VIEW' (this will throw an Error in a future version of PHP) in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\includes\modules\content\index\templates\tpl_cm_i_card_products.php on line 29
Warning: Use of undefined constant MODULE_CONTENT_FOOTER_INFORMATION_DATA - assumed 'MODULE_CONTENT_FOOTER_INFORMATION_DATA' (this will throw an Error in a future version of PHP) in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\includes\modules\content\footer\cm_footer_information_links.php on line 45

Warning: Invalid argument supplied for foreach() in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\includes\modules\content\footer\cm_footer_information_links.php on line 45
Warning: Use of undefined constant MODULE_CONTENT_FOOTER_TEXT_HEADING_TITLE - assumed 'MODULE_CONTENT_FOOTER_TEXT_HEADING_TITLE' (this will throw an Error in a future version of PHP) in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\includes\modules\content\footer\templates\tpl_cm_footer_text.php on line 2
MODULE_CONTENT_FOOTER_TEXT_HEADING_TITLE

http://localhost/2019_03_03_2.3.4.1._EDGE_BS4/index.php?cPath=1
Categorie level index_nested
NOTE: repeated error from box and footer removed.
Warning: Use of undefined constant MODULE_CONTENT_IN_CARD_PRODUCTS_TITLE - assumed 'MODULE_CONTENT_IN_CARD_PRODUCTS_TITLE' (this will throw an Error in a future version of PHP) in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\includes\modules\content\index_nested\cm_in_card_products.php on line 29

Warning: Use of undefined constant MODULE_CONTENT_IN_CARD_PRODUCTS_DESCRIPTION - assumed 'MODULE_CONTENT_IN_CARD_PRODUCTS_DESCRIPTION' (this will throw an Error in a future version of PHP) in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\includes\modules\content\index_nested\cm_in_card_products.php on line 30
Warning: Use of undefined constant MODULE_CONTENT_IN_CARD_PRODUCTS_HEADING - assumed 'MODULE_CONTENT_IN_CARD_PRODUCTS_HEADING' (this will throw an Error in a future version of PHP) in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\includes\modules\content\index_nested\templates\tpl_cm_in_card_products.php on line 2
MODULE_CONTENT_IN_CARD_PRODUCTS_HEADING
Warning: Use of undefined constant MODULE_CONTENT_IN_CARD_PRODUCTS_BUTTON_VIEW - assumed 'MODULE_CONTENT_IN_CARD_PRODUCTS_BUTTON_VIEW' (this will throw an Error in a future version of PHP) in C:\xampp_php_7_2_9\htdocs\2019_03_03_2.3.4.1._EDGE_BS4\includes\modules\content\index_nested\templates\tpl_cm_in_card_products.php on

 

Link to comment
Share on other sites

Link to comment
Share on other sites

  • 2 weeks later...

As PHP 7.2 is now fairly well established (and PHP 7.3 is starting to show up), any thoughts on how "Frozen" could be upgraded to work on 7.2 and up? If there are a lot of changes to make, perhaps general guidelines would be in order, rather than an exhaustive list of fixes (or even an add-on!). This would still leave a lot of work to be done by shop owners, but it may be the best we can do. Add-ons will be yet another issue.

I presume that Edge is/will be PHP-7.2 ready out of the box, but there are still a lot of people on Frozen just because it's nice and stable. That's the one that I install for clients. Once Slushee comes out (next freeze of Edge), that is at least PHP-7.2 ready, I would assume that any further work on Frozen would cease.

And oh, how about calling the next one osC 2.3.5? It's obvious that HPDL is never going to accept any of Gary's work as the official product, and he's probably never going to release another osC, so why not ease the confusion?

Link to comment
Share on other sites

  • 1 month later...

With a big thanks to @Heatherbell I have a day next week and a day the week after to commence work on;

  • fixing php7.2 warnings and errors
  • translating old x.x (some of which relates to php4!) php code to newer 7.x formatted code

In the meantime, if anyone sees any more errors/warnings please reply to this thread stating what the error says and where you found it (eg an URL) or how you made the error appear (eg only happens when pressing edit on XYZ module) and so on.  As much details as you can give would be very helpful.

Link to comment
Share on other sites

Gary is this pertaining just to edge core related errors?  I have some add ons that are causing some notices, etc.

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...