fleeced Posted August 2, 2015 Share Posted August 2, 2015 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. I had previously got my site working on PHP 5.3 with info from http://www.oscommerce.com/forums/topic/381320-since-were-updating-deprecated-session-and-ereg-solutions/ Then came stuck in PHP 5.4, but found this fix on a site on the web http://www.stevekamerman.com/2007/01/oscommerce-doesnt-work-on-php5-seriously/ 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 More sharing options...
MrPhil Posted August 2, 2015 Share Posted August 2, 2015 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.