Zen Cart Logo
Forums / Installing on a Linux/Unix Server / Issues with copying store to home server for testing/educational purposes

Issues with copying store to home server for testing/educational purposes

Views: 2,366

Results 1 to 11 of 11
17 Nov 2015, 6:45 PM
#1
ted_grapler avatar

ted_grapler

New Zenner

Join Date:
Nov 2015
Location:
New Jersey USA
Posts:
76
Plugin Contributions:
0

Issues with copying store to home server for testing/educational purposes

Trying to copy my store over to a dedicated home server and running into a few issues.

My webstore has been up and running on a major budget hosting provider for a few years with almost no issues. It's a v151 (not an upgrade) and I think only plugins are Cherry Zen template, Edit Orders, Lightbox, Image Handler 4, and Easy Populate.

Interested in learning about Linux, servers, PHP, MySQL, etc. so following info found online set up a home computer with Ubuntu Server 14.04.3, made it a LAMP server, installed MyPHPAdmin, Curl, and probably a few other things. I was able to install Zen Cart 1.51 with no apparent problems. The default store with demo items looked to be working perfectly. Then FTPed my online store files and database and copied them over to the home server following closely the instructions found on this forum at https://www.zen-cart.com/content.php?142.

After some learning curve hiccups eventually figured everything out and my home test server looked exactly like my online site except for (at least) two things I can't fix. The one I want to solve first: some unwanted HTML text that shows up when you click on any Category. The text shows up right before the dropdown box and for example in my Cameras category looks exactly like this:

Home :: Camera-Photo :: Cameras

Cameras

Sort by: $value) { if($key != 'sort' and $key!='show_order' and $key!='disp_order') { //echo ''; echo zen_draw_hidden_field($key, $value); } } ?>

The rest of the page looks good. At first I thought a file got corrupted in download so retried (several times), also tried different folders, erasing everything and starting over, and a few other things. No matter what I do that unwanted text is always there. Obviously it looks like there is a "<" missing but don't know what file to edit, or why it happens every install. So now am thinking it might be due to the fact that my home server and the hosting server are running different versions of PHP, MySQL or other OS software issues. The next thing was going to do is to try to change my home server so it has all the same versions of the software as the hosting server but before I try that figured would try to get some input on the forum.

Here is my home server configuration:

Server Information
Server Host: ubuntugra (127.0.1.1) Database Host: localhost (127.0.0.1)
Server OS: Linux 3.19.0-33-generic Database: MySQL 5.5.46-0ubuntu0.14.04.2
Server Date: 11/17/2015 10:55:48 Database Date: 11/17/2015 10:55:48
Server Up Time: 10:55:48 up 1:21, 0 users, load average: 0.00, 0.02, 0.04 HTTP Server: Apache/2.4.7 (Ubuntu)
PHP Version: 5.5.9-1ubuntu4.14 (Zend: 2.5.0) PHP Memory Limit: 128M PHP Safe Mode: Off
PHP File Uploads: On Max Size: 17M POST Max Size: 18M
Database Data Size: 6,861 kB

Here is the live/online hosting server configuration:

Server Information
Server Host: icpu3219 (XX.XXX.XXX.188) Database Host: XXXXXXXXXX.com (XXX.XX.XXX.20)
Server OS: Linux 3.2.72-grsec-infong-15294 Database: MySQL 5.1.73-log
Server Date: 11/17/2015 13:24:12 Database Date: 11/17/2015 13:24:12
Server Up Time: HTTP Server: Apache
PHP Version: 5.4.45 (Zend: 2.4.0) PHP Memory Limit: 120M PHP Safe Mode: Off
PHP File Uploads: On Max Size: 40M POST Max Size: 8M
Database Data Size: 6,865 kB Database Index Size: 1,619 kB

Any suggestions on how to solve this would be appreciated, as well as general recommendations on setting up a home test server. Server is just for testing and educational purposes and I don't plan on setting up email or trying to actually host the site from home. Once everything is running smoothly I plan on backing everything up then running upgrade to 1.54 to see how that goes.

Second issue has to do with Image Handler 4 only bringing up Large image popups on mouseover. On my live site it will bring up small or medium size images as I have it set up to do.

Thanks. Ted

17 Nov 2015, 7:11 PM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Issues with copying store to home server for testing/educational purposes

The issue you are seeing is related to short tags and that your php.ini doesn't recognize/allow them...

A short tage would be like <? Instead of <?php
The example provided is/was typical of a few templates in ZC 1.5.1... As to the "bouncing" around of databases, the fact that your local machine is using php 5.5 and your site is on 5.4, there will/may be password issues if you take your local database to your remote database without upgrading the PHP version on your remote site...

As to the IH4 "issue(s)", hover of "small" images only works under designated conditions which are described in the IH4 instruction.

18 Nov 2015, 2:57 AM
#3
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Issues with copying store to home server for testing/educational purposes

Ted,

Both php versions (on your web and local dev server) are compatible with the latest version of ZC. Since you are running 1.5.1 you may want to practice some upgrading of your ZC installation on your Ubuntu box and upgrade to ZC 1.5.4.

To find any short tags in your php file system open a terminal (Ctrl+Alt+T) and type in

sudo grep -rl "<? " /var/www/yourlocalsite (or the equivalent path to your local website)
enter password
hit enter

and it brings up a list of all files with the opening short tag <? instead of <?php

In my command make sure you leave a space between the ? and the " or else it brings up 1000's of files as it also looks for <?php

Once you found the files with a short tag open them and then change <? to <?php and you should be ok.

As for IH, try and install imagemagick (sudo apt-get install imagemagick) and imagemagick-common, see if that helps.

Cheers / Frank

18 Nov 2015, 3:13 AM
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Issues with copying store to home server for testing/educational purposes

Same check can be done within ZC: tools->Developers Tool Kit, lower left corner, same thing make sure a space after <?

Line number and file is returned.

18 Nov 2015, 5:27 PM
#5
ted_grapler avatar

ted_grapler

New Zenner

Join Date:
Nov 2015
Location:
New Jersey USA
Posts:
76
Plugin Contributions:
0

Re: Issues with copying store to home server for testing/educational purposes

Thanks mc12345678 and Frank.

First I searched all my site files for "<? " using Developers Tool Kit found one instance under easypopulate.php. It was (<? echo $tempdir; ?>) I edited it to be (<?php echo $tempdir; ?>) and does not show up anymore. That did not solve the issue with the unwanted text showing up on my test site.

Using Putty and running sudo grep -rl "<? " /var/www/yourlocalsite causes a seemingly never-ending list of JPG files to come up from my /localsite/images folder.

Any suggestions will be appreciated.

Thanks, Ted

18 Nov 2015, 5:51 PM
#6
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Issues with copying store to home server for testing/educational purposes

narrow the search down by searching in sudo grep -rl "<? " /var/www/yourlocalsite/includes and ```
sudo grep -rl "<? " /var/www/yourlocalsite/YOUR_ADMIN

and also search for <?= (shortcode for <?php echo )
19 Nov 2015, 3:56 PM
#7
ted_grapler avatar

ted_grapler

New Zenner

Join Date:
Nov 2015
Location:
New Jersey USA
Posts:
76
Plugin Contributions:
0

Re: Issues with copying store to home server for testing/educational purposes

Thanks for the info Design75. Tried all those searches but no "<? " or "<?=" in any of my non-image files. If you or anyone has other suggestions what might be causing the error please respond. Also would like to get opinions on if downgrading the PHP software on my home test server would be worth a try if only just to see if it fixes issue.

Ted

19 Nov 2015, 4:53 PM
#8
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Issues with copying store to home server for testing/educational purposes

How about postng the page source in the area of the issue, so that the code surrounding that area can be found and then the "error" corrected. Please post between ```
[CODE] and [/CODE]

19 Nov 2015, 7:36 PM
#9
ted_grapler avatar

ted_grapler

New Zenner

Join Date:
Nov 2015
Location:
New Jersey USA
Posts:
76
Plugin Contributions:
0

Re: Issues with copying store to home server for testing/educational purposes

OK hopefully this is right. On my test server web page the unwanted text shows up right after "Sort by: and ends right before the dropdown box which is default set at Product Name. Unwanted characters look like this: $value) { if($key != 'sort' and $key!='show_order' and $key!='disp_order') { //echo ''; echo zen_draw_hidden_field($key, $value); } } ?>

      <!--eof-branding display-->
      <!--eof-header logo and navigation display-->
      <!--bof-optional categories tabs navigation display-->
            <!--eof-optional categories tabs navigation display-->
      <!--bof-header ezpage links-->
                        <!--eof-header ezpage links-->
    </div>
      <div id="contentMainWrapper">
    <div id="contentMainWrapperb">
      <div class="outer">
        <div class="inner">
          <div class="float-wrap">
            <div id="content">
              <div class="contentWrap">
			                  <!-- bof  breadcrumb -->
                                <div id="navBreadCrumb">  <a href="http://192.168.77.127/tedscart/">Home</a> :: 
  <a href="http://192.168.77.127/tedscart/index.php?main_page=index&cPath=110">Camera-Photo</a> :: 
Cameras
</div>
                                <!-- eof breadcrumb -->
                                <!-- bof upload alerts -->
                                <!-- eof upload alerts -->
                <div class="centerColumn" id="indexProductList">

<h1 id="productListHeading">Cameras</h1>



<br class="clearBoth">


<div id="sorter">
<label for="disp-order-sorter">Sort by: </label>
<form name="sorter_form" action="http://192.168.77.127/tedscart/index.php?main_page=index" method="get"><!--?foreach($_GET as $key=-->$value)
{
	if($key != 'sort' and $key!='show_order' and $key!='disp_order')
	{
	//echo '<input name="'.$key.'" value="'.$value.'" type="hidden">';
	echo zen_draw_hidden_field($key, $value);
	}
}
?>
19 Nov 2015, 8:02 PM
#10
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Issues with copying store to home server for testing/educational purposes

Well, that explans why we were all "wrong".

Use your preferred search methd to look for:

<!--?foreach

And change that to:

<?php foreach
19 Nov 2015, 10:06 PM
#11
ted_grapler avatar

ted_grapler

New Zenner

Join Date:
Nov 2015
Location:
New Jersey USA
Posts:
76
Plugin Contributions:
0

Re: Issues with copying store to home server for testing/educational purposes

Searching for "<!--?foreach" came up empty. Tried a number of variations and finally using "?foreach" found: /tedscart/includes/templates/cherry_zen/templates/tpl_snaf_display_order.php

Line 21 was: <?foreach($_GET as $key=>$value)

I changed it to <?php foreach($_GET as $key=>$value)

The annoying characters are now gone and the Category pages all look exactly like my live webstore. Thanks for your help.

Ted