Stupid osCommerce is still living in the dark ages, using things like register_globals and $HTTP_POST_VARS – come on guys – get with the program! Following my theme of being forced to fix every program I try to use, I have patched osCommerce 2.2 Milestone 2 Update 060817 to work with PHP 5. Luckily this is an easy fix. First download it from the link above and install the Register Globals Patch (look for VV 1.5 – ZIP Archive).
Now that we have that issue solved we just need to fix the $HTTP_*_VARS issue – these are old school PHP3 variables that were included in PHP4 for compatibility.
Copy this and put it in a file called php5fix.php in your catalog/includes directory:
// 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;
}
?>
Now edit catalog/admin/includes/application_top.php and add this just below the comments at the top:
require_once("../includes/php5fix.php");
Edit catalog/includes/application_top.php and add this just below the comments at the top:
require_once("includes/php5fix.php");
If you haven’t completed the installation yet, do this too:
Edit catalog/install/application.php and add this just below the comments at the top:
require_once("../includes/php5fix.php");
Now you should be good to go! I’ll take a bow and pat myself on the back now – have a nice day
P.S. I suppose I could fix up a fresh installation and provide you with a link to download it from if you want. Somebody please email me if you want it, otherwise I’m wasting my time.
« New Major Tera-WURFL Release – v1.4.4 Actionscript doesn’t make copies of Objects – it makes references »

Did you consider Zen-Cart? I'm evaluating it these days. It's basically a spin-off of osCommerce, seems to have good templates, has a number of pre-installed mods and is compatible with many original osC templates.
I looked at it about a year ago and I thought it was a little too simple, but I'll take another look at it! My fingers are getting a little tired from making eCommerce sites from scratch.
I'm getting closer to finishing a complete scheduling and eCommerce framework in PHP, JS and Flash so I can stamp these sites out like cookies, but I've got a little ways to go yet
. Thanks for the comment!
I may be wrong, but it seems like the paths are wrong here, may i suggest just to put php5fix.php in the same directory as the files mentioned below and use —-
require_once("php5fix.php"); only.
Copy this and put it in a file called php5fix.php in your *****catalog/includes******* directory:
Now edit catalog/admin/includes/application_top.php and add this just below the comments at the top:
// PHP5 fix
*****require_once("../includes/php5fix.php");*****
Edit catalog/includes/application_top.php and add this just below the comments at the top:
// PHP5 fix
*****require_once("includes/php5fix.php");*****
Thanks, man! I've been searching solution on the net and I've found your site. Thanks for sharing. Greetings from Bulgaria,
nikoto
[:)] many thanks! my problem solved
Thanks, this helped me a lot!
Besides, since my situation was that I migrated from servers (one that had PHP4 running to a new one, with PHP5) I found a couple of extra problems. Just in case it's useful for someone:
- Admin didn't show up due to an error in the file upload.php:
[url=http://kb.siteground.com/article/oscommerce_fatal_error_cannot_reassign_this.html]http://kb.siteground.com/article/oscommerce_fatal_error_cannot_reassign_this.html[/url]
- Admin showed a weird message regarding the images directory:
[url=http://forums.oscommerce.com/lofiversion/index.php?t172622.html]http://forums.oscommerce.com/lofiversion/index.php?t172622.html[/url]