Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

No $language without register_globals


Niclas Schwarz

Recommended Posts

I want to run my 2.2 osComm shop on a webspace who runs php 5.4, meaning I have to deactivate register_globals. But if I do it it get this error message:

PHP Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required 'includes/languages/.php' (include_path='.:/php5.2.17/lib/php') in /admin/includes/application_top.php on line 145

and all product_prices are set to 0.

 

I am not very familiar with osComm code, but I figured out that $language never has a value when I echo+die it.

When I set $language = en; or something else the price values come back but I still cant put nothing into my shopping cart, which I think must be a session problem or something.

I don't want to upgrade to 2.3 because my shop is strongly modified.

 

Is someone familiar with this issue or has any suggestions how to continue?

Link to comment
Share on other sites

If you don't want to start fresh with a new 2.3.3.4 shop then you can do the manual upgrade one version at a time from the one you have and up, it's a tedious task but it will make your shop work on PHP5.4

Link to comment
Share on other sites

The best thing to do is to upgrade to osC 2.3.3.4, which has tons of bug fixes and is PHP 5.4 compatible. If that's not feasible, you'll have to research how to insert the "compatibility layer" to eliminate the need for register global variables and copy $_* to $HTTP_*_VARS, among other things. Then you need to patch the PHP code to remove all the "deprecated" warnings, and install all the security patches. My suggestion is to install osC 2.3.3.4 and migrate the existing database to the new level. If your shop isn't working now, you can do it "in place", but you're usually better off installing 2.3.3.4 in a new private directory and working with a copy of the current database. You can play with it for a bit as you see what add-ons you want to install and any custom code or theme changes you want.

Link to comment
Share on other sites

Try to avoid using the step-by-step upgrades beyond osC 2.2 RC2a. To go to osC 2.3.0 leaves you with a "Frankenstore" hybrid that's not well supported and difficult to apply new add-ons to.

Link to comment
Share on other sites

Yes, thats been my biggest fear, too. My first attempt to fix the register_globals issue was by using this register_globals patch from the addons page, but that caused me just hell of other issues like crashing cookies/sessions and currencies.

But the changes of the reg_glob-commit worked fine on me. Thank you very much. Kind of fixed one week debugging in 20 minutes.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...