1 Attachment(s)
Runing Zen cart site in a folder
Please can someone help me check the setup of our working site. We have a working site that is breaking when I try to install Square webpay.
After asking on the threads for webpay I have been advised my problem is a more general setup issue and I should post it in the main area, so here goes, can anyone help please?
Site originally setup in 2013, upgraded a few times now, working fine, SSL and site is in a subfolder.
Minimal customisations, only a few addons (cookie control, google re-captcha, inventory report, minimum order, sales report, square webpay)
No issues till I attempted to add Square webpay, apparently it is rather sensitive about how you configure things if you are running your site in a sub folder, now this hasn't caused any issues before, running in a folder is how I did it from the start but apparently I have not properly defined this in my configure files. I do not think I have made any significant changes to these files, so they are pretty much as installed other than turning on SSL a few years back.
I retried with the update to the config files but it goes wrong. In the help files for Square Webpay it mentions properly defining in the config file the "DIR_WS_HTTPS_CATALOG constant", now apparently we haven't, so I made the change in both files (configure.php in both admin and store) - but only those two lines and it broke the site!
the edits were:
define('DIR_WS_CATALOG', '/JPV3/');
define('DIR_WS_HTTPS_CATALOG', '/JPV3/');
(the store is in a folder called JPV3)
I have now changed it back and its working fine. I was wondering if these are added to the https info and so maybe I just needed to reissue/renew the SSL cert?
Site info:
URL is https://www.j e r w o o d p h i l a t e l i c s .co.uk/
ZC version 1.5.8a, working fine since, previously upgraded from 1.5.6 and before that 1.5.3 I think
PHP 8.1
Mysql 5.7
hosted by Ionos (previously known as 1and1)
I have tried to attach the edited config files but the attachment keeps being rejected for invalid file type, i have tried .php and .txt - what should it be so i can show the forum?
It broke the storefront not the admin side. The storefront wound up looking like the attached image:
Attachment 20387
Thank you in advance, George
Re: Runing Zen cart site in a folder
Your configure.php can look one of two ways.
My reccomendation is to have your host create a 301 redirect pointing YOUR_DOMAIN to YOUR_DOMAIN/CART_FOLDER. That's the best practice and will match the SSL That way, you will NOT need to make any changes to your two configure.php files and folks won't see the name of your cart folder.
Right now, going to YOUR_DOMAIN/CART_FOLDER, the browser claims that the URL has just been registered and tells you that you need to go online to manage the site.:no:
BUT, if I go to YOUR_DOMAIN, I get the shopping cart.:dontgetit
This is your chance to see if your host can do their stuff.
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Non-recommended Solution vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
If your host cannot create a 301 redirect for you, you can change your configure.php files to accomplish the redirect in the slowest manner possible :(
Code:
/**
* Enter the domain for your store
* If you have SSL, enter the correct https address in BOTH the HTTP_SERVER and HTTPS_SERVER settings, instead of just an http address.
*/define('HTTP_SERVER', 'https://YOUR_DOMAIN);define('HTTPS_SERVER', 'https://YOUR_DOMAIN);/**
* If you have https enabled on your website, set this to 'true'
*/define('ENABLE_SSL', 'true');/**
* These DIR_WS_xxxx values refer to the name of any subdirectory in which your store is located.
* These values get added to the HTTP_CATALOG_SERVER and HTTPS_CATALOG_SERVER values to form the complete URLs to your storefront.
* They should always start and end with a slash ... ie: '/' or '/foldername/'
*/define('DIR_WS_CATALOG', '/CART_FOLDER/');
define('DIR_WS_HTTPS_CATALOG', '/CART_FOLDER/');
Farther on in the config you would need to have:
Code:
/**
* This is the complete physical path to your store's files. eg: /var/www/vhost/accountname/public_html/store/
* Should have a closing / on it.
*/
define('DIR_FS_CATALOG', '/home/YOUR_USERNAME@HOST/public_html/CART_FOLDER/');
Re: Runing Zen cart site in a folder
Morning,
I do not find your store in a directory. It's displaying in the public root, no folder.
IF your store is actually in a folder, the redirect is a good idea, but redirecting with .co.uk is tricky because it's technically a sub-domain. Make sure you test the redirect extensively. However, I do not see it in a folder.
I also think you should check the setup your configure files is correct.
Like so
admin/includes/
define('HTTP_SERVER', 'https://www.domain.co.uk');
define('HTTP_SERVER', 'https://www.domain.co.uk');
define('HTTPS_SERVER', 'https://www.domain.co.uk');
Make sure to use the www based on your site's Google indexing.
includes/
define('HTTP_SERVER', 'https://www.domain.co.uk');
define('HTTPS_SERVER', 'https://www.domain.co.uk');
Make sure to use the www based on your site's Google indexing.
admin/includes/
define('ENABLE_SSL_CATALOG', 'true');
includes/
define('ENABLE_SSL', 'true');
admin/includes/
define('DIR_FS_CATALOG', '/home/full/path/to/store/with/trailing/');
includes/
define('DIR_FS_CATALOG', '/home/full/path/to/store/with/trailing/');
admin/includes/
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');
includes/
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');
~Melanie
4 Attachment(s)
Re: Runing Zen cart site in a folder
Hi, huge thank you to dbltoe and mprough, I do appreciate your time/help. I am still puzzled though, sorry. I have told Ionos (formerly 1and1) to point to the folder where ZC is via the settings/options they have, please see the attached image, the Destination is my webspace (which i believe is referenced in the FS in the config) and the Target is the correct folder, is this the same as a 301 redirect or do i still need to do that? Please see image, hopefully it will make sense.
I have also attached images of the two config files, editing out the specifics as per previous instructions (hopefully), i am hoping this makes it a little easier to see what is going on. I believe the FS values are set correctly, the WS part is the bit that breaks if i update it to reference the folder.
The store definitely is in a folder, the folder does not ever show when a product is accessed, or added to the cart.
Further advice based on my config files would be greatly appreciated, thank you in advance, George
Attachment 20390
Attachment 20391
Attachment 20392
Attachment 20393
Re: Runing Zen cart site in a folder
admin/includes/
define('DIR_WS_CATALOG', '/JPV3/');
define('DIR_WS_HTTPS_CATALOG', '/JPV3/');
includes/
define('DIR_WS_CATALOG', '/JPV3/');
define('DIR_WS_HTTPS_CATALOG', '/JPV3/');
IF it is genuinely in a folder in the public root.
Otherwise, if it's not...
admin/includes/
define('DIR_FS_CATALOG', '/homepages/7/######/htdocs/JPV3/');
includes/
define('DIR_FS_CATALOG', '/homepages/7/######/htdocs/JPV3/');
I'm still not understanding why the redirect. The site is indexed without the folder. Was the store always in the folder? It just doesn't make any sense =(
~Melanie
Re: Runing Zen cart site in a folder
Perhaps there's an .htaccess ReWrite to send root-directory accesses to that sub-directory.
Re: Runing Zen cart site in a folder
Quote:
Originally Posted by
lat9
Perhaps there's an .htaccess ReWrite to send root-directory accesses to that sub-directory.
Possibly.
Quote:
It broke the storefront not the admin side. The storefront wound up looking like the attached image:
This statement implies to me that the configure files do not match.
So if Lat is right and they configured your public root to be /JPV3/ then BOTH configure files would be like so.
admin/includes/
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');
admin/includes/
define('DIR_FS_CATALOG', '/homepages/7/######/htdocs/JPV3/');
includes/
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');
includes/
define('DIR_FS_CATALOG', '/homepages/7/######/htdocs/JPV3/');
It would also mean that your issues with the Square plugin are not related to this. Also your SSL is fine, so that doesn't look to be the issue.
Do you have the exact error message you received from the plugin?
Can you contact your host and get the rundown of this folder? Specifically whether it's your public root or not.
When you upgraded Zen Cart are you sure all of the files are upgraded?
Are you using the stock Square plugin or Square Web pay plugin (https://www.zen-cart.com/downloads.p...file&id=2345)?
~Melanie