Jump to content

Archived

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

Irin

osc v2.3.4 and php v7.0 incompatible?

Recommended Posts

Hello,

I'm having incompatibility issues with my osCommerce v2.3.4 and PHP v7.0. Many add-ons just stopped displaying after my hosting provider upgraded me to the latest PHP v7.0 and MariaDB 10.1. Are there any steps to upgrade my osc to support the latest versions of php and mariadb?

Thanks in advance,

Irina

Share this post


Link to post
Share on other sites

After enabling error_reporting, it's showing me whole bunch of deprecated errors:

Quote


Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; logger has a deprecated constructor in /public_html/shop/admin/includes/classes/logger.php on line 13

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; shoppingCart has a deprecated constructor in /public_html/shop/admin/includes/classes/shopping_cart.php on line 13

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; tableBlock has a deprecated constructor in /public_html/shop/admin/includes/classes/table_block.php on line 13

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; box has a deprecated constructor in /public_html/shop/admin/includes/classes/box.php on line 26

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; messageStack has a deprecated constructor in /public_html/shop/admin/includes/classes/message_stack.php on line 20

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; splitPageResults has a deprecated constructor in /public_html/shop/admin/includes/classes/split_page_results.php on line 13

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; objectInfo has a deprecated constructor in /public_html/shop/admin/includes/classes/object_info.php on line 13

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; mime has a deprecated constructor in /public_html/shop/admin/includes/classes/mime.php on line 18

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; email has a deprecated constructor in /public_html/shop/admin/includes/classes/email.php on line 20

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; upload has a deprecated constructor in /public_html/shop/admin/includes/classes/upload.php on line 13

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; actionRecorderAdmin has a deprecated constructor in /public_html/shop/admin/includes/classes/action_recorder.php on line 15

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; actionRecorder has a deprecated constructor in /public_html/shop/includes/classes/action_recorder.php on line 13

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; cfg_modules has a deprecated constructor in /public_html/shop/admin/includes/classes/cfg_modules.php on line 13

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; cfgm_social_bookmarks has a deprecated constructor in /public_html/shop/admin/includes/modules/cfg_modules/cfgm_social_bookmarks.php on line 13

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; cfgm_boxes has a deprecated constructor in /public_html/shop/admin/includes/modules/cfg_modules/cfgm_boxes.php on line 13

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; cfgm_payment has a deprecated constructor in /public_html/shop/admin/includes/modules/cfg_modules/cfgm_payment.php on line 13

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; cfgm_order_total has a deprecated constructor in /public_html/shop/admin/includes/modules/cfg_modules/cfgm_order_total.php on line 13

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; cfgm_header_tags has a deprecated constructor in /public_html/shop/admin/includes/modules/cfg_modules/cfgm_header_tags.php on line 13

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; cfgm_dashboard has a deprecated constructor in /public_html/shop/admin/includes/modules/cfg_modules/cfgm_dashboard.php on line 13

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; cfgm_action_recorder has a deprecated constructor in /public_html/shop/admin/includes/modules/cfg_modules/cfgm_action_recorder.php on line 13

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; cfgm_shipping has a deprecated constructor in /public_html/shop/admin/includes/modules/cfg_modules/cfgm_shipping.php on line 13

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; currencies has a deprecated constructor in /public_html/shop/admin/includes/classes/currencies.php on line 16

 

Share this post


Link to post
Share on other sites

Irina...you will need to either update your version of osC to the most recent community version which has been updated for php 7 or you'll need to manually update the individual files in the version of osC you are using so it will run on php 7.  Either way there are several posts on the forum here to guide you, if you google for them.

Dan

 

Share this post


Link to post
Share on other sites

The reason I'm not updating to BS version is that I have a lot of add-ons installed, and the BS doesn't offer step-by-step update instructions. I didn't really find any good posts that offer update instructions.

Share this post


Link to post
Share on other sites

I don't think you'll find a step by step guide but there are definitely posts that will explain what to do about those deprecated constructor error messages you're seeing.   If you're not comfortable making changes like this yourself post in the commercial forums for a quote to get the work done.   You should also develop a strategy to keep your shop (version of osC) up to date so you are not in the same situation the next time your host updates to an even more recent version of php. 

Dan

Share this post


Link to post
Share on other sites

i did change every class file to the __construct.

I can not under stand, why the osC devloper did not change that and why there still programming the old code. Also osC 3.0
dosen't run with php 7. and PHP 5.6 will be finish at 31. Dec 2018. I am really sad about that, than maybe this will bring the
good osC more an more down.


  • The clever one learn from everything and from everybody
  • The normal one learn from his experience
  • The silly one knows everything better

[socrates, 412 before Christ]

Computers help us with the problems we wouldn't have without them!
99.9% of the bugs sit in front of the computer!
My programmed add-ons: WDW EasyTabs 1.0.3, WDW Facebook Like 1.0.0

if(isset($this) || !isset($this)){ // that's the question...

 

Share this post


Link to post
Share on other sites
7 hours ago, Irin said:

The reason I'm not updating to BS version is that I have a lot of add-ons installed, and the BS doesn't offer step-by-step update instructions. I didn't really find any good posts that offer update instructions.

You will get a lot problem in the future. Everybody should start to change to a PHP7 compatible version. Don't stay with the old code stuff.


  • The clever one learn from everything and from everybody
  • The normal one learn from his experience
  • The silly one knows everything better

[socrates, 412 before Christ]

Computers help us with the problems we wouldn't have without them!
99.9% of the bugs sit in front of the computer!
My programmed add-ons: WDW EasyTabs 1.0.3, WDW Facebook Like 1.0.0

if(isset($this) || !isset($this)){ // that's the question...

 

Share this post


Link to post
Share on other sites
7 hours ago, mcmannehan said:

You will get a lot problem in the future. Everybody should start to change to a PHP7 compatible version. Don't stay with the old code stuff.

I'm amazed at the number of users having php7 problems already when only 4.3% of all sites are using it at this point according to Web Technology Surveys.

Quote

PHP version 7 is used by 4.3% of all the websites whose server-side programming language we know.

Recommending that shop owners get ahead of this is excellent advise.

Dan

PS: Does anyone know how to add @mentions using the new forums software?  I see folks using it but I'm not seeing how.

Share this post


Link to post
Share on other sites
7 hours ago, mcmannehan said:

i did change every class file to the __construct.

I can not under stand, why the osC devloper did not change that and why there still programming the old code. Also osC 3.0
dosen't run with php 7. and PHP 5.6 will be finish at 31. Dec 2018. I am really sad about that, than maybe this will bring the
good osC more an more down.

Just so there is no misunderstanding the latest version of EDGE is php7 ready.  See this post...

Dan

 

Share this post


Link to post
Share on other sites
9 hours ago, mcmannehan said:

i did change every class file to the __construct.

I can not under stand, why the osC devloper did not change that and why there still programming the old code. Also osC 3.0
dosen't run with php 7. and PHP 5.6 will be finish at 31. Dec 2018. I am really sad about that, than maybe this will bring the
good osC more an more down.

If you have a look into the changes for PHP 7 compatibility in the latest 2.3.4 BS Edge version, you'll find that maybe 95% is done with the class constructor name update you explain. But there are some more updates left, for example add an empty class constructor function to some classes and other mods. So it's not THAT easy.

As already pointed out by Dan Cole, the actual 2.3.4 BS version is up to date for PHP7 and all my updated Add-ons for 2.3.4 BS also. The same for most other 2.3.4 BS responive ready add-ons. Of course most old add-ons for standard 2.3.4 and older are not PHP 7 ready.

Otherwise don't get in panic, PHP 5.6 for sure will not be removed from the hosts on 1. Jan. 2019. Therer are still many hosts which even do not offer PHP 7 yet.

 

rgds

Rainer

Share this post


Link to post
Share on other sites

I had to change class constructor to function __construct in almost every file in the below directories, and most of my deprecated errors are gone.

Admin Side
    classes
    functions
    modules    

Shop Side
    classes
    functions
    modules/action_recorder
    modules/boxes
    modules/content
    modules/header_tags
    modules/navbar_modules
    modules/order_total
    modules/payment
    modules/shipping
    modules/social_bookmarks

However, I still see a few errors left. Here are some of them:

Quote

Fatal error: Uncaught Error: Call to undefined function split() in /public_html/shop/includes/modules/product_listing.php:141 Stack trace: #0 /public_html/shop/advanced_search_result.php(352): require() #1 {main} thrown in /public_html/shop/includes/modules/product_listing.php on line 141

Quote

Fatal error: Uncaught Error: Call to undefined function mysql_real_escape_string() in /public_html/shop/admin/whos_online.php:182 Stack trace: #0 /public_html/shop/admin/whos_online.php(212): updateIps('66.249.79.156,4...') #1 /public_html/shop/admin/whos_online.php(373): add_geolocation() #2 {main} thrown in /public_html/shop/admin/whos_online.php on line 182

Quote

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /public_html/shop/admin/database_admin.php:59 Stack trace: #0 {main} thrown in /public_html/shop/admin/database_admin.php on line 59

 

Share this post


Link to post
Share on other sites

If I change mysql to mysqli, the error is gone.

Share this post


Link to post
Share on other sites

×