Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Running 2.2 MS2 on PHP Version 4.4.9 -> can I migrate to PHP5.4?


Mark the Harp

Recommended Posts

Hi - an apologies as I'm sure this is asked a lot - but I created my shop many years ago (and it's been running flawlessly ever since) so as a consequence I haven't poked around in the shop files for some time and have pretty much forgotten all I ever knew (not much!) about php and mySQL etc. at http://www.danceofdelight.com

 

However....my host (1&1 internet) is migrating to PHP5.4

 

Is there any way of migrating my shop which is on 2.2-MS2 and running happily on PHP 4.4.9 to something which is compatible with PHP 5.4?

 

I'm most worried about messing up the special pages I've created but also messing up the database. I'm not sure I can face rebuilding the shop from scratch!

 

Mark

Link to comment
Share on other sites

You have two options;

 

1. update this site so that it is capable of running on 5.4.

or

2. update to a more recent version of osc, aka 2.3.3 (soon to be 2.3.4)

 

In either case, it is not a simple job and if you have the budget, you should leave it to an expert.

Probably #1 is simpler if you DIY, as there is an addon which shows some stuff to change to make a shop 5.4 compatible

 

note also that you may require SQL changes as well in the code to deal with an upgrade of MySQL

Link to comment
Share on other sites

You have two options;

 

1. update this site so that it is capable of running on 5.4.

or

2. update to a more recent version of osc, aka 2.3.3 (soon to be 2.3.4)

 

In either case, it is not a simple job and if you have the budget, you should leave it to an expert.

Probably #1 is simpler if you DIY, as there is an addon which shows some stuff to change to make a shop 5.4 compatible

 

note also that you may require SQL changes as well in the code to deal with an upgrade of MySQL

 

I like the option 1 - do you know at all where that addon is to make it 5.4 compatible? I have seen odd bits around the forum / site but nothing that looks like a comprehensive list of things to change. I'm imagining it's a whole load of search/replace/adding/deleting blocks of text, and if that's the case I'm up for that.

Link to comment
Share on other sites

@@Mark the Harp

 

There isn't an add on for that. You would have to download the RC1 cart and update it using the included instructions, Then, download the RC2 and follow the instructions, then download v2.30, 2.31, 2.3.2 and finally 2.3.3. Each has a document file to update the cart.

 

 

I know Gary suggested this as an option, however by doing it that way you are creating a 'frakencart', whereby you are piecing bits of code into your cart to make it work like the most recent version. I DO NOT personally recommend this as a hybrid is never as stable as a new installation.

 

I suggest creating a new cart using v2.3.3 and then integrate your data into the new database. This will provide you with a stronger, more stable cart.

 

 

 

Chris

Link to comment
Share on other sites

  • 3 months later...

Hi All,

 

I never got back on this but here I am!

 

In April my host (1&1) is switching from mysql4 and php4.0 to mysql5 and php5.4. I have been running MS2.2 which has been serving me well, and because my store has been working flawlessly I haven't paid it much attention on the coding side. Rather than try to go through several upgrades, it seems good advice just to bite the bullet and start again with the latest 2.3.3 release, so THANK YOU ALL for your help on that.

 

I have now installed 2.3.3 using a new MySQL5 database. It seems a fairly simple matter to go into the old MS2.2 product descriptions in admin, and copy the text across and add new images since there are better image upload options than when aI built my store all those years ago. I have lost my customer database from the old store but have a local copy that I can run on a local server on my machine, so at least I can get at the info for accounting purposes. It's not a hugely busy shop now so I'm not expecting hordes of new customers or even repeat ones.

 

A couple of questions, though:

 

1) Where I've uploaded multiple product images to my new product descriptions, I've noticed I'm gettting wrong images - for example, if a product has four images, sometimes two will be wrong (and those same two wrong ones appear on other products too) and somtimes all four of them will be wrong.

 

possibly related to this?:

 

2) I uploaded the new 2.3.3 to my current php version (php4) but at the moment I have the ability to switch from the (current) php4 to php5.4 (which will be imposed on me from 1 Apr). The new install doesn't work in 5.4 - or rather, I'm getting various messages about time zones, and the admin pages don't work at all. Should I have switched to php5.4 before uploading the new store? If I backup / export the database to the new store I've built, presumably I can switch to 5.4, install again, and then import the database I've just painstakingly created? Or is there something more fundamental, like the shop won't work in php5.4?

 

=================================

 

Here are the messages I'm getting at the top of the store, when I switch the php version to 5.4:

 

Strict Standards: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CET/1.0/no DST' instead in /homepages/12/d85031895/htdocs/Shop/newshop/catalog/includes/functions/compatibility.php on line 54

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /homepages/12/d85031895/htdocs/Shop/newshop/catalog/includes/functions/compatibility.php:54) in /homepages/12/d85031895/htdocs/Shop/newshop/catalog/includes/functions/sessions.php on line 102

 

=================================

 

And the admin pages don't work at all. Here's what I get:

 

 

Strict Standards: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CET/1.0/no DST' instead in /homepages/12/d85031895/htdocs/Shop/newshop/catalog/admin/includes/functions/compatibility.php on line 54

 

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /homepages/12/d85031895/htdocs/Shop/newshop/catalog/admin/includes/functions/compatibility.php:54) in /homepages/12/d85031895/htdocs/Shop/newshop/catalog/admin/includes/functions/sessions.php on line 102

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /homepages/12/d85031895/htdocs/Shop/newshop/catalog/admin/includes/functions/compatibility.php:54) in /homepages/12/d85031895/htdocs/Shop/newshop/catalog/admin/includes/functions/sessions.php on line 102

 

Warning: Cannot modify header information - headers already sent by (output started at /homepages/12/d85031895/htdocs/Shop/newshop/catalog/admin/includes/functions/compatibility.php:54) in /homepages/12/d85031895/htdocs/Shop/newshop/catalog/admin/includes/functions/general.php on line 38

 

=================================

Link to comment
Share on other sites

...I should just add, in the new PHP5.4 version of the store, nothing works apart from the top page - if I click on a product I get

 

Strict Standards: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CET/1.0/no DST' instead in /homepages/12/d85031895/htdocs/Shop/newshop/catalog/includes/functions/compatibility.php on line 54

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /homepages/12/d85031895/htdocs/Shop/newshop/catalog/includes/functions/compatibility.php:54) in /homepages/12/d85031895/htdocs/Shop/newshop/catalog/includes/functions/sessions.php on line 102

 

Warning: Cannot modify header information - headers already sent by (output started at /homepages/12/d85031895/htdocs/Shop/newshop/catalog/includes/functions/compatibility.php:54) in /homepages/12/d85031895/htdocs/Shop/newshop/catalog/includes/functions/general.php on line 49

Link to comment
Share on other sites

Hi all,

 

Well - I fixed some of it!

 

Added the following line to catalog/includes/application_top.php and catalog/admin/includes/application_top.php:

 

ini_set('date.timezone', 'UTC');

 

That seems to work although when I click on a product or category, the page just refreshes. Everything else works (cart / policies etc) just the indiv products can't be accessed. So maybe I've done the wrong thing?

Link to comment
Share on other sites

Yeah, all your error messages were a consequence of not having explicitly set a timezone. Your use of ini_set() in the application_top.php files is fine, or you could have set it date.timezone = 'UTC' in a php.ini file. As of PHP 5.4, I don't think they will accept a TZ environment variable anymore.

 

Your host is jumping you all the way from 4.4.9 to 5.4.x? That's not very good -- were they indulging you all this time by letting you stay on such an old version, or have they really not gotten around to upgrading for many years? I haven't heard of anyone routinely running PHP 4 in many years -- everyone else has been at least at 5.2 for quite a while.

 

I don't know what the story is with "click -> page refreshes". This is osC 2.3.3 with PHP 5.4 and MySQL 5? No older versions of anything accidentally mixed in? Are you getting any error messages in any system logs, in error_log files, or on-screen?

 

You didn't need to cut and paste (or retype) all your product data into the new store. You could have imported the data from the old database backup (.sql file) after updating it to reflect the changes in the database schema. You still might be able to (selectively) pull in your existing customer data tables using phpMyAdmin, but be sure to back up your new database first, in case you mess up, and know how to restore it.

Link to comment
Share on other sites

I think they were just indulging me! But interesting that under the old php version the shop was allowing me to view the different products. I wonder if this is tied to the random image thing? Although can't think how. If I installed OSC under php 4.4.9 is that likely to have been the problem? Should I reinstall with the server running 5.4?

 

Sorry - you can probably tell I'm clueless about this.

Link to comment
Share on other sites

Are you asking about a fresh install of osC 2.3.3 on PHP 4.4.9 and then switch to PHP 5.4, versus fresh install of osC 2.3.3 on PHP 5.4? Off the top of my head, I can't think of why that would make any difference, although without going over the code with a fine toothed comb I'm not prepared to make an uncategorical statement. If you preserve your database via a backup, or don't mind resetting it to a base installation, you should be able to wipe your current site and do a fresh install of 2.3.3 on 5.4. If you have backups (file and database) and know how to restore them, you can try anything.

 

If you have a working store right now (running under PHP 4.4.9) and don't want to risk disrupting it, you make yourself a "sandbox" where you set up to run PHP 5.4 and install and play with the new store there until you're ready to cut over to the new one for production. Most hosts have a setting in either /.htaccess or /php.ini to say which PHP version to run under, so hopefully you can run two versions with two stores simultaneously (PHP 4.4.9 production store and PHP 5.4 test store). Just make sure the test store has its own database so your production database doesn't get overwritten. Some people will suggest setting up a server on your PC (XAMPP or WAMPP), but I recommend against it. You're going to have more trouble trying to get a local server to work than just sticking with your real server.

Link to comment
Share on other sites

@@MrPhil - that's exactly it. I could try loading a fresh install on PHP 5.4. Presumably I backup the database from my existing 2.3.3 store, download the sql file, install the new one and then upload the sql file into admin/backups and then restore that?

Link to comment
Share on other sites

Yes, you should be able to back up and restore a 2.3.3 database. You might run into minor MySQL differences if you're doing this to move from MySQL 4 to MySQL 5 -- you might have to edit the .sql file to change "TYPE=" to "ENGINE=" or something like that. See if you get an error message about that first.

Link to comment
Share on other sites

That's interesting - haven't done the reinstall but switched the server back to php4.4.9 and the shop works (ie, you click on products or categories and it does what you'd expect. Still getting the wrong images though. So this is an odd one.

 

Anyway, will try a new installation while running PHP 5.4 and then restore the database and images to see if that does the job.

Link to comment
Share on other sites

Hi - just reinstalled 2.3.3 under php 5.4 and the default shop all works correctly now without error message. However, when I restored my database it again won't allow me to click on the categories / products as before - basically clicking on any products just returns me to index.php, showing the "new products for March".

 

If I click on any category, I get exactly the same display except the URL is index.php/cPath/23 or whatever corresponds to that category. But the actual page display is still "new products for March".

 

Any ideas anyone??!

 

shop is here

Link to comment
Share on other sites

In your admin under configuration>MY store set use Use Search-Engine Safe URLs to false

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...