Forums / Installing on a Windows Server / Setting up a Test Site Environment via Wamp (with an existing ZenCart site)

Setting up a Test Site Environment via Wamp (with an existing ZenCart site)

Started by roberth on 12 Aug 2015, 2:02 PM · Views: 7,685

Results 1 to 16 of 16
12 Aug 2015, 2:02 PM
#1
roberth avatar

roberth

New Zenner

Join Date:
Aug 2015
Posts:
63
Plugin Contributions:
0

Setting up a Test Site Environment via Wamp (with an existing ZenCart site)

So I've just installed Wamp (2.5) and I want to get a copy of an already existing ZenCart site to work in the wamp server so that changes can be tested there first before being rolled out live.

My ZenCart (1.5.0) versions are:
PHP: 5.3.5
MySQL: 5.1.54
Apache Server (don't know what version from Tool -> Server Info)
Database Patch Level 1.5.0

I've tried a few sources of instruction on how to get it working, and even seem to have successfully installed zencart in a separate directory on wamp (www/zencart/). But when trying to visit the site from Wamp (www/MySite/index.php/) I get the ZenCart message about either not having installed zencart, or having incorrect paths for configure.php files. I tried to make some changes to paths in configure.php according to the guides that I'd found but none of the changes were successful.

Mostly I'm interested in a step by step guide to go from fresh install of Wamp to a running copy of my site in the test environment - if possible. Otherwise point-and-shoot troubleshooting would still be helpful.

I tried to provide clarifying information and explanation of the issue I'm having but if anything more is needed I can provide it so as to best describe what is/is not working.

12 Aug 2015, 2:51 PM
#2
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Location:
Longs, SC
Posts:
635
Plugin Contributions:
0

Re: Setting up a Test Site Environment via Wamp (with an existing ZenCart site)

RobertH:

I've tried a few sources of instruction on how to get it working, and even seem to have successfully installed zencart in a separate directory on wamp (www/zencart/). But when trying to visit the site from Wamp (www/MySite/index.php/) I get the ZenCart message about either not having installed zencart, or having incorrect paths for configure.php files. I tried to make some changes to paths in configure.php according to the guides that I'd found but none of the changes were successful.
When you say you successfully installed zencart what do you mean? Did you create a database, copy the zencart files to the directory, and run the install? Did you copy the files from your existing site and try to edit the config files? Did you create a database in the wamp environment and import your existing database? It would help if you give more info on what steps you executed.

12 Aug 2015, 3:34 PM
#3
roberth avatar

roberth

New Zenner

Join Date:
Aug 2015
Posts:
63
Plugin Contributions:
0

Re: Setting up a Test Site Environment via Wamp (with an existing ZenCart site)

badarac:

When you say you successfully installed zencart what do you mean? Did you create a database, copy the zencart files to the directory, and run the install? Did you copy the files from your existing site and try to edit the config files? Did you create a database in the wamp environment and import your existing database? It would help if you give more info on what steps you executed.

Well I ran the zencart installation through wamp, but it seems like it's installed in its own directory inside wamp (www/zencart/) I don't know if it will be accessible to other projects outside the directory - is why I wrote "seem to".

I did create a database in Wamp's PhpmyAdmin during the installation process, but I haven't imported the existing database - not entirely sure how to go about that.

The files for the existing site are in a directory in wamp/www/ as well which is why it seems to me like the zencart install was separated from the files of the existing site - this is where I was looking for the most help. I saw guides on how to install zencart into wamp by itself, but not necessarily how to install it when there's an existing site. I don't know how the site files and the zencart install files need to be integrated within wamp.

I tried a few scattered things I found that seemed like they might have been related to my problem. I haven't really been able to keep track of all of them which is why I tried to express my willingness to start from scratch. A new wamp install and an existing ZC site.

Does this clarify at all?

12 Aug 2015, 4:34 PM
#4
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Location:
Longs, SC
Posts:
635
Plugin Contributions:
0

Re: Setting up a Test Site Environment via Wamp (with an existing ZenCart site)

Let me try and give you a high level step by step for a couple scenarios.
New install:

In wamp select phpmyadmin and create a new database. If you left the program defaults alone the database userid will be root and the database password will be blank. You'll need those for the install.

Download the zencart zip file and extract it to a directory you create in wamp/www. Start wamp and when it starts click on the wamp icon, then select localhost(the same place you accessed phpmyadmin to create the database).

Select the directory where you extracted the zencart code. The installation of zencart should start.

Go through the zencart install specifying the database name, userid, and password when asked.

Rename the admin directory and install directory. You should now be able to select the directory from localhost in wamp and have it open in the browser. Access the admin by adding /whateveryourenamedtheadmindirectory.

Existing site:> Create a directory in wamp/www and copy your existing site files to it.

From the cpanel on your live site go to phpmyadmin(or whatever tool they provide to manage your database). Select your live database and export it. If you are going to import it to an existing zencart database (like the one from the prior scenario) then be sure to include the drop tables option.

Select phpmyadin in wamp and go to the database you created. Import the database using the export from the live site.

Edit the config files that you copied to the local directory with the local info. I've found that the simplest way to get the config files right is to do a new install of zencart to get the config files built, then replace all the files from the fresh local install with the ones from your live site except the config files. That ensures that the config files reflect the correct urls, directories, and database info.

If you've done everything correctly you should be able to launch the live site from the localhost directory.

12 Aug 2015, 5:07 PM
#5
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Setting up a Test Site Environment via Wamp (with an existing ZenCart site)

Also be sure that in your local site that the DB_PREFIX is the same as in your live site... (if the define in the live site's includes/configure.php for DB_PREFIX is like: define('DB_PREFIX', ''); then there is no prefix to be concerned about).

Otherwise, as part of the process to import the data to your local site as badarac suggests, the DB_PREFIX in both includes/configure.php and YOUR_SECRET_ADMIN/includes/configure.php of your local site should be changed to what the live site uses in order to work with the imported data.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

12 Aug 2015, 6:42 PM
#6
roberth avatar

roberth

New Zenner

Join Date:
Aug 2015
Posts:
63
Plugin Contributions:
0

Re: Setting up a Test Site Environment via Wamp (with an existing ZenCart site)

Alright I've taken the steps you laid out badarac, as well as checked and matched the DB_PREFIX lines in the local site's configure.php files like mc said.

When navigating to the directory in localhost now instead of getting the ZenCart page - saying it needed to be installed, or the paths fixed - I get a simple line of text saying "WARNING: An Error occurred, please refresh the page and try again."

When I tried it before changing the DB_PREFIX lines, the page was simply white. After changing those prefix lines to match how they are on the live site, now the page loads that error in a single line of text.

12 Aug 2015, 8:38 PM
#8
roberth avatar

roberth

New Zenner

Join Date:
Aug 2015
Posts:
63
Plugin Contributions:
0

Re: Setting up a Test Site Environment via Wamp (with an existing ZenCart site)

mc12345678:

Blank, partial blank or message like received: http://www.zen-cart.com/content.php?124-blank-page

It's a completely blank page with one line of type: "WARNING: An Error occurred, please refresh the page and try again."

12 Aug 2015, 8:53 PM
#9
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Setting up a Test Site Environment via Wamp (with an existing ZenCart site)

RobertH:

It's a completely blank page with one line of type: "WARNING: An Error occurred, please refresh the page and try again."

Understood. That's why the link was provided as it is to a FAQ about how to move forward from that issue... Please revew the content of the link, post information in the logs if you wish. Do not divulge your SECRET_ADMN_DRECTORY even if it is a test enviironment on a local computer, it's a good practice.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

13 Aug 2015, 3:37 PM
#10
roberth avatar

roberth

New Zenner

Join Date:
Aug 2015
Posts:
63
Plugin Contributions:
0

Re: Setting up a Test Site Environment via Wamp (with an existing ZenCart site)

Well I started over (again) with a fresh WAMP install and following https://www.zen-cart.com/content.php?142-i-want-to-move-my-zen-cart-installation-to-another-host-or-a-different-server instructions. I ended up in the same spot - with a blank screen and the "WARNING: An Error occurred, please refresh the page and try again."

My most recent error logs in /cache/ are:

Admin:

[13-Aug-2015 17:00:13 Europe/Paris] PHP Fatal error:  Call to undefined function money_format() in C:\wamp\www\localsite\SECRET_ADMIN_NAME\index.php on line 149

[13-Aug-2015 17:00:13 Europe/Paris] PHP Stack trace:

[13-Aug-2015 17:00:13 Europe/Paris] PHP   1. {main}() C:\wamp\www\localsite\SECRET_ADMIN_NAME\index.php:0

Non-Admin

[13-Aug-2015 16:58:21 Europe/Paris] PHP Fatal error:  1054:Unknown column 'p.products_carrot' in 'field list' :: select p.products_tax_class_id, p.products_carrot, p.products_price from nhd_products p where p.products_id = '0'  in C:\wamp\www\localsite\includes\classes\db\mysql\query_factory.php on line 101

[13-Aug-2015 16:58:21 Europe/Paris] PHP Stack trace:

[13-Aug-2015 16:58:21 Europe/Paris] PHP   1. {main}() C:\wamp\www\localsite\index.php:0

[13-Aug-2015 16:58:21 Europe/Paris] PHP   2. require() C:\wamp\www\localsite\index.php:26

[13-Aug-2015 16:58:21 Europe/Paris] PHP   3. require() C:\wamp\www\localsite\includes\application_top.php:149

[13-Aug-2015 16:58:21 Europe/Paris] PHP   4. require() C:\wamp\www\localsite\includes\autoload_func.php:48

[13-Aug-2015 16:58:21 Europe/Paris] PHP   5. include() C:\wamp\www\localsite\includes\init_includes\init_templates.php:83

[13-Aug-2015 16:58:21 Europe/Paris] PHP   6. include() C:\wamp\www\localsite\includes\modules\extra_definitions.php:73

[13-Aug-2015 16:58:21 Europe/Paris] PHP   7. queryFactory->Execute() C:\wamp\www\localsite\includes\languages\english\extra_definitions\free_gifts.php:24

[13-Aug-2015 16:58:21 Europe/Paris] PHP   8. queryFactory->set_error() C:\wamp\www\localsite\includes\classes\db\mysql\query_factory.php:208

[13-Aug-2015 16:58:21 Europe/Paris] PHP   9. queryFactory->show_error() C:\wamp\www\localsite\includes\classes\db\mysql\query_factory.php:86

[13-Aug-2015 16:58:21 Europe/Paris] PHP  10. trigger_error() C:\wamp\www\localsite\includes\classes\db\mysql\query_factory.php:101
13 Aug 2015, 4:19 PM
#11
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Setting up a Test Site Environment via Wamp (with an existing ZenCart site)

Well, based on that error message for the admin side... The default ZC admin/index.php at line 149 for ZC v1.5.0 (and 1.5.4) is a blank line. So, how has the admin/index.php file been modified to increase the line numbers and what is the code at/around line 149?

It appears that possibly some files from your live site have not made it/or not fully made it to your demo site... In your live site if you goto the admin screen, then tools->developers tool kit, you can search (suggest lower left corner) on money_format to see where the function money_format is provided to then possibly copy that file over from the live site to the demo site to get through this one error... Problem is that if that one file didn't make it, what other file(s) did not?

Oh, also the function money_format is not a default function within ZC, so it was added by some other modification.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

13 Aug 2015, 4:48 PM
#12
roberth avatar

roberth

New Zenner

Join Date:
Aug 2015
Posts:
63
Plugin Contributions:
0

Re: Setting up a Test Site Environment via Wamp (with an existing ZenCart site)

mc12345678:

Well, based on that error message for the admin side... The default ZC admin/index.php at line 149 for ZC v1.5.0 (and 1.5.4) is a blank line. So, how has the admin/index.php file been modified to increase the line numbers and what is the code at/around line 149?

It appears that possibly some files from your live site have not made it/or not fully made it to your demo site... In your live site if you goto the admin screen, then tools->developers tool kit, you can search (suggest lower left corner) on money_format to see where the function money_format is provided to then possibly copy that file over from the live site to the demo site to get through this one error... Problem is that if that one file didn't make it, what other file(s) did not?

Oh, also the function money_format is not a default function within ZC, so it was added by some other modification.

I'll preface this post by saying I ( think I ) got it working!

After trying to resolve the errors from the logs myself I did find that certain things were missing/incorrect about the local database vs. the live one. So I dropped the database, made a new one of the same name, and imported the sql from the live database again. I think that the problem was either on the import, or that running the zencart installation within wamp with this database created conflicts in zencart's "prepping" of the database and the already "prepped" live version copy.

After that I loaded the wamp directory with the site (with a version that was a mirror copy/paste of the live site files with edited configure.php's - instead of overwriting the files setup by a zencart install) and I got what mostly looked like our homepage, with some broken image links. After trying to navigate the site there, I realized that it is meant to be run from the host's root directory and that I have it one level down (it's in wamp/www/MySite/root_files where it should be in wamp/www/root_files for the php to work correctly)

after moving the files to the correct directory (and once again fixing configure.php files to reflect this change) it (seems to) work correctly through Wamp. Taking stock of where I went wrong in getting this working from the get-go, I don't think I ever needed to run a zencart install through Wamp, and the correct importing of the live database was obviously crucial. These are the big marks that stunted my progress and sent me on a path that was much more complicated than this process really needed to be.

Anyway I thank you both for all your assistance and advice and i hope at least one person in a similar situation as I was in can stumble across this thread as I wish I had to get them on the right track.

Thanks again.

13 Aug 2015, 5:04 PM
#13
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Setting up a Test Site Environment via Wamp (with an existing ZenCart site)

RobertH:

I'll preface this post by saying I ( think I ) got it working!

After trying to resolve the errors from the logs myself I did find that certain things were missing/incorrect about the local database vs. the live one. So I dropped the database, made a new one of the same name, and imported the sql from the live database again. I think that the problem was either on the import, or that running the zencart installation within wamp with this database created conflicts in zencart's "prepping" of the database and the already "prepped" live version copy.

After that I loaded the wamp directory with the site (with a version that was a mirror copy/paste of the live site files with edited configure.php's - instead of overwriting the files setup by a zencart install) and I got what mostly looked like our homepage, with some broken image links. After trying to navigate the site there, I realized that it is meant to be run from the host's root directory and that I have it one level down (it's in wamp/www/MySite/root_files where it should be in wamp/www/root_files for the php to work correctly)

after moving the files to the correct directory (and once again fixing configure.php files to reflect this change) it (seems to) work correctly through Wamp. Taking stock of where I went wrong in getting this working from the get-go, I don't think I ever needed to run a zencart install through Wamp, and the correct importing of the live database was obviously crucial. These are the big marks that stunted my progress and sent me on a path that was much more complicated than this process really needed to be.

Anyway I thank you both for all your assistance and advice and i hope at least one person in a similar situation as I was in can stumble across this thread as I wish I had to get them on the right track.

Thanks again.

The biggest benefit of running the zc_install is getting the paths correct in the configure.php files... After that, well, all the rest of the site surrounding those two files can be delivered to the folder(s) in place of the files that are/were there.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

22 Sep 2015, 8:46 PM
#14
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

Re: Setting up a Test Site Environment via Wamp (with an existing ZenCart site)

Hi. This is a helpful post.

However, I believe it is not actually dealing with the upgrade versus rebuild problem. I'm not sure if MC had any intention to upgrade or rebuild. It seems not.

I anticipate taking the new includes/configure.php and admin/includes/configure.php files and inserting the name of my database, and substituting those for the configure.php files that were downloaded from my online website.

That's where MC seems to have ended his toil.

If I follow this, my site will still be in Zencart version 1.3.9h. I have installed version 1.5.4 in a Zencart separate database on the WAMP, and thought I would like to try both an upgrade and a rebuild.

For the upgrade, I believe I would need to somehow activate zc-install and choose something that does an upgrade. I expect complete chaos after that, because my database still has many modules that may not work, and many, many products, lots of which are no longer available. I'm not sure whether it would be worthwhile to clean the site of old products and modules not used or no longer compatible with 1.5.4.

For the rebuild, I'm not certain how to differentiate, in the database, between the store itself and the products associated with the store, of which there are many, in addition to which, it's a bilingual site.

I'm also not sure what it means when it is mentioned that a "drop tables" functon should be used. Maybe that is how one drops all products and modules, but I am not sure; and then one would repopulate the products with easy populate.

How far off track am I in trying to visualize an upgrade versus a rebuild? Could the "drop tables" reference be clarified as to what it does or means?

Thanks for further help.

Notageek

23 Sep 2015, 12:14 AM
#15
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Setting up a Test Site Environment via Wamp (with an existing ZenCart site)

So I've done a ZC upgrade one time and personally never care to do it that way ever again. It was almost 4 years ago when ZC 1.5.0 was available and I was pgrading from 1.3.9h. I reviewed the documentation, modified every file that was identified as changed, deleted each deleted file, added each new file and went through each override file to be sure they contained the latest enhancement(s). I had originally installed the software with an auto installer to get all the base setup going (mainly to get the database part addressed) and then was in the process of replacing the files with a set from this website when I discovered that the host was behind the times...

The site while online was not heavily trafficed and while that upgrade process did momentarily take it offline, I'll just say that it was far more trouble than it was worth especially with so many other tools and easier ways to do this. Every other store that I have worked on since then I have done by rebuilding the site to provide an upgraded verson (hence the use of upgrade/rebuild as it provides an upgraded site by rebuilding it.)

As far as the above discussion, I don't believe I was the center of the discussion of needing to either upgrade or rebuild. But I would say easiest to rebuild, generally speaking. Either way, the database is addressed through the same basic process... Further, the previous installation of other plugins generally will not prevent the operation of that store when using core files only... Sure certain features and options won't be available at that time but the store will still operate...

Basically and generally speaking, the database modifications made by your other plugins will not negatively affect the upgrade process of the database. Of course the other plugins will have to be updated and their data appropriately addressed to prevent losing that data if it can not be easily reapplied, but they too should be able to be installed/upgraded without data loss...

So, how does one upgrade the database? like you indicated, upload the zc_install directory to the store, then access the zc_install directory. You will need admin profile credentials to be able to do the database upgrade. You will (should) see notices that your configure.php files are not writeable, this is not a problem and actually is a safety measure to prevent you from completely deleting your database.

As for drop tables, that is an option when working in phpmyadmin. Drop tables as is will literally drop all of the tables from the database leaving an empty location that can be accessed, but has no "individual" data other than the overhead to have a database...

I'm pretty sure that your head is already swimming from all of that, but... Wondered why I might have stopped where I did in explanation? Well that individual didn't express the need to know anything further about the process and seemed to be well on their way to what they needed/wanted... Believe it or not I do try to not write a book at every post. :)

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

23 Sep 2015, 1:01 AM
#16
notageek avatar

notageek

Zen Follower

Join Date:
Mar 2009
Posts:
418
Plugin Contributions:
0

Re: Setting up a Test Site Environment via Wamp (with an existing ZenCart site)

Note to MC: I love books.

This one is also is helpful.

Notageek