Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Quick fix for those 2.2 stores that work in PHP 5.3 but not PHP 5.4


fleeced

Recommended Posts

For those who need a quick fix if there host upgrades to PHP 5.4 without notice, this fix get store working under PHP 5.4. Eventually you need these replacing across the site. But seems to work for now, hopefully of use to someone as a stopgap.

 


 

Then came stuck in PHP 5.4, but found this fix on a site on the web

 


 

Create a php5fix.php with

 

<?php

// PHP5 Fix by Steve Kamerman, http://www.teratechnologies.net/stevekamerman

 

$phpversion = explode('.', phpversion());

if((int) $phpversion[0] >= 5){

// PHP 5 has no idea what this crap is

$HTTP_GET_VARS = &$_GET;

$HTTP_POST_VARS = &$_POST;

$HTTP_REQUEST_VARS = &$_REQUEST;

$HTTP_SESSION_VARS = &$_SESSION;

$HTTP_COOKIE_VARS = &$_COOKIE;

$HTTP_SERVER_VARS = &$_SERVER;

$HTTP_FILES_VARS = &$_FILES;

$HTTP_ENV_VARS = &$_ENV;

}

?>

 

Place file in includes folder of catalog and admin

 

Then ref to it in application top as (i placed mine on line 33 after code block // include server parameters)

 

require_once("php5fix.php");

Link to comment
Share on other sites

If you are behind the times enough to be still running a very old (e.g., 2.2 MS2) version of osC, you may indeed need to add this code. However, the later 2.2 (RC2, etc.) versions already have code like that to take care of the earlier PHP 5 versions. Note that even with these "fixes", there are other things that will break in osC's code with more recent PHP 5 versions. The only real solution is to migrate your data to the current osC version (2.3.4 or Bootstrap).

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...