Jump to content

Testing Cubecart On two mirrored hosts


Triscot

Recommended Posts

The title to this issue might not be technically accurate, but I hope is close.  We have outgrown our server. Our hosting company has setup a new larger server:  The procedure to copy all of the accounts from old server to new server was done by using the Backup Restoration function in WHM.  Each account was downloaded from the old server, then upload to the new server.  The the backup restoration process was done on new server.  After the restoration was done testing between old and new servers was performed by using the "hosts" file on my local computer (PC) to force my browser to point my DNS as needed.  Other than a few small database issues all directories (40+) worked fine except Cubecart. When accessing Cubercart through the Wordpress menu or directly pasting the url into the browser (http://africandesertcrafts.com/shop/http://africandesertcrafts.com/shop6/)  I get a blank page.

I have read the blog post "How do I move my cubecart store from one hosting account to another" but in this situation it does not apply exactly. New server hostname is the same as the old server

The method to test has been using the "hosts" file on my local computer (PC) to force my browser to point my DNS to old or new.  I verified through myphp that the database files are all in place ( africand_ccrt6 ) I have checked the global.inc.php file (located  /public_html/shop/includes/global.inc.php-dist) and the:

dbdatabase=  'africand_ccrt6

dbhost =  'localhost'

dbusername = (is correct)

dbpassword = (is correct)

I have checked the  .htaccess  file

 RewriteBase /shop6/ (for testing purposes shop6 exists in two directories: public_html/shop and public_html/shop6)
ErrorDocument 404 /shop6/index.php

 

Is it possible that all is well but there is no way to test prior to the DNS changes made to the server

 

 

Link to comment
Share on other sites

Not at all.  The problem/solution you are referring to was the shop on the "old" server.  Your suggestion about permalinks worked, so problem solved.  The current  problem is copying this "fixed" shop to new server as described above.  The use of the "hosts" file was suggested by my host provider.  It has worked great!  I caught several problems before going live.

 

Link to comment
Share on other sites

Not at all.  The problem/solution you are referring to was the shop on the "old" server.  Your suggestion about permalinks worked, so problem solved.  The current  problem is copying this "fixed" shop to new server as described above.  The use of the "hosts" file was suggested by my host provider.  It has worked great!  I caught several problems before going live.

 

Okay I have reached out to havenswift will let all know if I hear something.

Link to comment
Share on other sites

Using a programmer's text editor (not a word processor), please create a file called ini-custom.inc.php, and have as its contents:

<?php
# Custom initialization commands
# Filename: ini-custom.inc.php
# File location: main CubeCart folder

ini_set('memory_limit', '256M');
ini_set('max_execution_time', '60');
ini_set('error_log', 'error_log');
ini_set('log_errors', 'on');

?>

Place this file in CubeCart's main folder at your site.

Your hosting control panel's set of tools may have an editor available.

If the problem is with CubeCart, and you get the blank page, there should be a new file named error_log in the main folder.

We can look at the contents and maybe learn the reason why there is this problem.

Link to comment
Share on other sites

I would recommend trying to find out what the actual error message is:

https://support.cubecart.com/Knowledgebase/Article/View/219/42/i-get-a-blank-white-screen-when-i-view-my-store

The method you have used to move the sites should be absolutely fine. Maybe the PHP configuration on the new hosts is different and there is missing functionality throwing a fatal error?

I commonly see this error if multibyte string support is not configured with PHP as CubeCart uses the function "mb_strtolower". 

Anyway thats just a guess. Once the error is known I am sure this is no big deal. 

Link to comment
Share on other sites

11 hours ago, bsmither said:

That is an interesting approach to using the workstation's 'hosts' file to force a name to IP resolution.

This is a very common method used to test site moves without affecting the live site or indeed being able to access a site after it has been migrated to a new host / server but before DNS propagation has been completed - we use it all of the time when migrating / testing sites.  Simple but extremely useful

1 hour ago, Al Brookbanks said:

The method you have used to move the sites should be absolutely fine. Maybe the PHP configuration on the new hosts is different and there is missing functionality throwing a fatal error?

I commonly see this error if multibyte string support is not configured with PHP as CubeCart uses the function "mb_strtolower".

I concur with Al, the method is good and pretty foolproof if done correctly.  My guess also would be different PHP version or different modules enabled and multibyte is a good bet.  In this situation we would probably have done it differently by ensuring a fully up to date R1Soft backup for the whole server was in place and then doing a Bare Metal Restore to the new server - that way you are 100% guaranteed that everything is exactly the same right down to OS setup and configuration.

Ian

Link to comment
Share on other sites

Thanks to all!  The problem turned out to be

10 hours ago, Al Brookbanks said:

I commonly see this error if multibyte string support is not configured with PHP

 

My hosting company enabled this service and things are now working. I was able was able to:

  • 15 hours ago, bsmither said:

    If the problem is with CubeCart, and you get the blank page, there should be a new file named error_log in the main folder.

    Found the following PHP Fatal error: Call to undefined function mb_convert_encoding()

  • Interesting I could go into the admin side and the  System Error Log"  showed no errors

  • In the end Havenswift Hosting method of moving from one server to another might have been a better approach

 

Last thought on this issue.  When reviewing the error log I have at least 100 entries as follows

[26-Apr-2016 10:13:18 America/Phoenix] PHP Warning:  No callback method defined. in /home/africandesertcra/public_html/shop/classes/cubecart.class.php on line 290

Any ideas how to fix this? Line 290 "// Update quantity"

Link to comment
Share on other sites

Your file may have had some edits that skewed the line numbers.

Anyway, someone is calling your store with this URL:
index.php?_g=somecode
where somecode is a feature trigger that CubeCart does not recognize.

Some known feature triggers are:

ajax_price_format: responds with locale-specific price formatting
ajax_email: responds with the customer_id of the given email
ajax_add: responds with the HTML containing an updated listing of the shopping basket
remote: processes external entities' notifications (such as payment gateways) and responds with 'OK'
Hooks are available to add custom features.

You may have disabled a plugin that provides a feature for a web page effect.

To clearly discern what that feature may be, you will need to examine your site's web server access log. Match the time/date (adjust for timezone differences) to determine the URL that contains the index.php?_g=somecode.

Link to comment
Share on other sites

1 hour ago, Triscot said:

Last thought on this issue.  When reviewing the error log I have at least 100 entries as follows

[26-Apr-2016 10:13:18 America/Phoenix] PHP Warning:  No callback method defined. in /home/africandesertcra/public_html/shop/classes/cubecart.class.php on line 290

Any ideas how to fix this? Line 290 "// Update quantity"

Please start a NEW post with this topic, and I'll move Bsmither's reply over to it. That way your original post, and its solution, can be marked as Resolved. Your struggle with this, and Al's solution would be of more help to someone else that way.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...