Zen Cart Logo
Forums / Installing on a Linux/Unix Server / Installing a new site

Installing a new site

Views: 2,392

Results 1 to 17 of 17
17 Aug 2016, 10:23 PM
#1
sfatula avatar

sfatula

New Zenner

Join Date:
Apr 2005
Location:
Calera, OK
Posts:
71
Plugin Contributions:
0

Installing a new site

I know this has changed at times in the past, and, I've been away from Zen Cart for many years now. Back to it. The doc says to rename dist-configure.php to configure.php, in store and admin. Fine, I do this. I run the installer, and, it says system setup is required.

In the past, I thought that Zen itself sets up the configure.php file. Not renaming dist-configure does not change anything. So, I presume the doc is correct. However, the PDF install doc for 1.5.5a never says to EDIT those files and put in valid data. Is this the way it works now, I must edit them both and set up database, paths, domain, etc.?

So, in that manual, does section 5.1 (New Installations) #2 (configure.php files) simply omit the fact that the files must not just be renamed, but, edited for content?

I really thought the zen installer created the files and asked you for the settings.

17 Aug 2016, 10:29 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Installing a new site

  1. You rename the files and set permissions on them so that Zen Cart can put the correct contents into them.
  2. You run zc_install and answer the questions in the brief interview it gives you (basically, to do the "system setup")
  3. Done
17 Aug 2016, 11:21 PM
#3
sfatula avatar

sfatula

New Zenner

Join Date:
Apr 2005
Location:
Calera, OK
Posts:
71
Plugin Contributions:
0

Re: Installing a new site

That's what I thought, but, not what I see. There are no logged errors by apache. I go to the install page via http://www.somedomain.com/zc_install, and, it merely gives the You are seeing this page for one or more reasons page.

Near as I can tell, it's looking for zc_install/includes/configure.php, which does not exist since the doc does not say to rename that one. I see a dist-configure.php there....

17 Aug 2016, 11:45 PM
#4
sfatula avatar

sfatula

New Zenner

Join Date:
Apr 2005
Location:
Calera, OK
Posts:
71
Plugin Contributions:
0

Re: Installing a new site

I am suspecting the install is not working with mod_fcgid so well with the relative paths.

17 Aug 2016, 11:56 PM
#5
frank18 avatar

frank18

Deceased

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

Re: Installing a new site

sfatula:

That's what I thought, but, not what I see. There are no logged errors by apache. I go to the install page via http://www.somedomain.com/zc_install, and, it merely gives the You are seeing this page for one or more reasons page.

Near as I can tell, it's looking for zc_install/includes/configure.php, which does not exist since the doc does not say to rename that one. I see a dist-configure.php there....

You don't need to do anything within the zc_install folder, nothing at all.

You do need to rename the 2 dist-configure.php files to configure.php and make them both writable. Prior to doing all of this, make sure you created a blank database on your server and have the credentials written down as you will need them when running the installer. A few more folders have to be made writable as well (see docs).

In the install package you find a docs folder, open that folder and you will find a file called 1.readme_installation.html - read through that file step by step. Don't skim over that file but read it thoroughly.

I found that the latest installer (ZC 1.5.5a) is the simplest installer since I got involved in ZC. When you run yoursite.com/zc_install it shows you what you reported in your post above (System Setup required etc.....). On that screen you find something like "Install Now" (forgot the exact wording) - click that link and the installer starts.

18 Aug 2016, 12:00 AM
#6
sfatula avatar

sfatula

New Zenner

Join Date:
Apr 2005
Location:
Calera, OK
Posts:
71
Plugin Contributions:
0

Re: Installing a new site

I agree you do not normally need to do anything with the zc_install folder. Read my follow up post though, I am using php via mod_fcgid, i.e., cgi, which changes things regarding paths. There is a doc for this, but it also does not work:

https://www.zen-cart.com/content.php?49-can-i-run-php-as-cgi-on-my-linux-unix-webserver

I have exactly followed the doc. It does not work as a cgi install of php. Nor does the recommendations of the linked to page above.

18 Aug 2016, 12:16 AM
#7
frank18 avatar

frank18

Deceased

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

Re: Installing a new site

sfatula:

I agree you do not normally need to do anything with the zc_install folder. Read my follow up post though, I am using php via mod_fcgid, i.e., cgi, which changes things regarding paths. There is a doc for this, but it also does not work:

https://www.zen-cart.com/content.php?49-can-i-run-php-as-cgi-on-my-linux-unix-webserver

I have exactly followed the doc. It does not work as a cgi install of php. Nor does the recommendations of the linked to page above.

Thanks Steve.

I did 3 fresh installs (for clients) this week, all on Linux servers similar to above, all went without a single glitch.

What exactly is your server environment?

18 Aug 2016, 12:16 AM
#8
sfatula avatar

sfatula

New Zenner

Join Date:
Apr 2005
Location:
Calera, OK
Posts:
71
Plugin Contributions:
0

Re: Installing a new site

To prove this theory, I created a small php program (omitting the start tag here):

if (file_exists('includes/configure.php')) {
include('includes/configure.php');
echo HTTP_SERVER . "\n";
}
require('include/configure.php');
echo HTTP_SERVER . " but file not found!\n";

This runs and echos HTTP_SERVER just fine when test.php is in the root apache directory for the site. It fails if the program is moved to zc_install directory. It fails because:

require(): Failed opening required 'include/configure.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/psd/public_html/zc_install/test.php on line 6

I might experiment with the include path just for the install. Been running ZEN under cgi just fine.

18 Aug 2016, 2:50 AM
#9
sfatula avatar

sfatula

New Zenner

Join Date:
Apr 2005
Location:
Calera, OK
Posts:
71
Plugin Contributions:
0

Re: Installing a new site

Server is Centos 7.2, standard Centos packages, so, httpd 2.4.6, mod_fcgid to run php (not mod_php), php 5.4.16, mariadb 5.5.47, not sure what else you would want. I suspect it may be possible to patch the install, if I get past it, Zen should run just fine. Always has before. Ideally, a better relative path would be used.

18 Aug 2016, 3:21 AM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Installing a new site

sfatula:

To prove this theory, I created a small php program (omitting the start tag here):

if (file_exists('includes/configure.php')) {
include('includes/configure.php');
echo HTTP_SERVER . "\n";
}
require('include/configure.php');
echo HTTP_SERVER . " but file not found!\n";

This runs and echos HTTP_SERVER just fine when test.php is in the root apache directory for the site. It fails if the program is moved to zc_install directory. It fails because:

require(): Failed opening required 'include/configure.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/psd/public_html/zc_install/test.php on line 6

I might experiment with the include path just for the install. Been running ZEN under cgi just fine.

There are two bugs with what you've posted here:
a) you used "includes/configure.php" and then "include/configure.php". Both should be "includes/". So your test is wrong.
b) You put your test inside zc_install, which does NOT have an "includes/configure.php" in it. The zc_install code specifically looks at the directory above it to find "includes/configure.php". It never looks for zc_install/includes/configure.php

It's been years since I bothered with Centos let alone mod_fcgi, but I know lots of others use that combination successfully with Zen Cart.

Zen Cart does expect your "include_path" to contain the "." folder, which according to the messages you posted, it does. So it's not an issue of looking up relative paths.

18 Aug 2016, 3:25 AM
#11
sfatula avatar

sfatula

New Zenner

Join Date:
Apr 2005
Location:
Calera, OK
Posts:
71
Plugin Contributions:
0

Re: Installing a new site

That is not what is happening. application_top.php does a check for includes/configure.php which it then claims does not exist under mod_fcgid. This is easily shown by adding a simple die statement. But /webroot/includes/configure.php DOES exist, and is readable. This works fine outside of mod_fcgid. click here does nothing other than display the screen below. Nothing has been done except the extract to public_html, and, the rename of the 2 dist-configure files.

Hello. Thank you for loading Zen Cart®.

You are seeing this page for one or more reasons:

  1. This is your first time using Zen Cart® and you haven't yet completed the normal Installation procedure.
    If this is the case for you, Click here to begin installation.
  2. Your /includes/configure.php and/or /admin/includes/configure.php file contains invalid path information and/or invalid database-connection information.
    If you recently edited your configure.php files for any reason, or maybe moved your site to a different folder or different server, then you'll need to review and update all your settings to the correct values for your server.
    Additionally, if the permissions have been changed on your configure.php files, then maybe they're too low for the files to be read.
    Or the configure.php files could be missing altogether.
    Or your hosting company has recently changed the server's PHP configuration (or upgraded its version) then they may have broken things as well.
    See the Online FAQ and Tutorials area on the Zen Cart® website for assistance.
  3. Additional IMPORTANT Details: includes/configure.php not found
18 Aug 2016, 3:43 AM
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Installing a new site

Actually, your Click Here does slightly more. You'll notice that the info for point #3 changes depending whether it's running from inside zc_install or not.

What's happening is your server isn't properly allowing PHP to read the path of the file being executed.

I've seen this happen with the occasional server running Nginx and PHP-FPM, and that was always resolved by properly configuring paths in Nginx and paths/ports in PHP-FPM.

Two things to try:
a) empty the contents of the configure.php files that you renamed from dist-configure.php .... just to ensure that it's not getting confused by the defaults it's reading from inside those (it tries to re-use your own data in case you're re-installing on the same server, but in your case none of the existing data is relevant, so emptying the files rules out that particular possibility)

b) The zc_install/index.php has some very simple code in it for setting DIR_FS_ROOT and DIR_FS_INSTALL, which your server doesn't seem to be playing properly with. Feel free to alter the code to suit your server's special needs.

18 Aug 2016, 3:58 AM
#13
sfatula avatar

sfatula

New Zenner

Join Date:
Apr 2005
Location:
Calera, OK
Posts:
71
Plugin Contributions:
0

Re: Installing a new site

It is a standard Centos base install with mod_fcgid, not fpm not nginx. You are correct, it is not finding the path correctly. It could be a bug even in some version being used by Centos, have not gotten that far. Still, very strange, we have several dozen sites (not Zen, our own software for various company purposes) running just fine using the same software of course being the same server.

Emptying did not help.

I don't see any code in zc_install/index.php dealing with DIR_FS_ROOT. There is some stuff in some ajax files.

Here's another curiosity. I downloaded 1.5.3 from your download site, and, extracted into public_html, and, did not rename anything, just went to the url, and, the welcome screen comes up, then the license page, etc. Didn't rename a thing, though, the procedure may have been different previously. So, 1.5.3 installs fine. So, something is different about 1.5.5a installer.

I do appreciate your thoughts here BTW. It's just been very frustrating as the install has always been pretty much trivial.

So, I wondered if 1.5.5.a would do the same, it does not.

So, there is something that has changed in 1.5.5a that breaks it (at a minimum for me) on a new install (at a minimum) when using mod_fcgid.

18 Aug 2016, 4:02 AM
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Installing a new site

sfatula:

I don't see any code in zc_install/index.php dealing with DIR_FS_ROOT. There is some stuff in some ajax files.
I dunno what file you looked at. See: zc_install/index.php

18 Aug 2016, 4:09 AM
#15
sfatula avatar

sfatula

New Zenner

Join Date:
Apr 2005
Location:
Calera, OK
Posts:
71
Plugin Contributions:
0

Re: Installing a new site

Ok, well, I see that there, but download from:

https://www.zen-cart.com/content.php?19-download

That is version 1.5.5a, not 1.5.5, is that the problem? 1.5.5.a presents itself as the current version???

If you download that from your site, you will see index.php is not as you show it to be.... At least for me.

Mine starts with this.... Maybe it's the unzip program

<?php /** * index.php represents the hub of the Zen Cart MVC system * * Overview of flow * <ul> * <li>Load application_top.php - see {@tutorial initsystem}</li> * <li>Set main language directory based on $_SESSION['language']</li> * <li>Load all *header_php.php files from includes/modules/pages/PAGE_NAME/</li> * <li>Load html_header.php (this is a common template file)</li> * <li>Load main_template_vars.php (this is a common template file)</li> * <li>Load on_load scripts (page based and site wide)</li> * <li>Load tpl_main_page.php (this is a common template file)</li> * <li>Load application_bottom.php</li> * </ul>
18 Aug 2016, 4:28 AM
#16
sfatula avatar

sfatula

New Zenner

Join Date:
Apr 2005
Location:
Calera, OK
Posts:
71
Plugin Contributions:
0

Re: Installing a new site

Thanks for that github link. Curiously, on Centos 7 (pseudo code, not actual dirs but to give you the idea):

cd public_html
unzip pathtothezensource.zip yields a bad extract with at least the zc_install/index.php as shown

However....

cd thedirwiththezipfile
unzip -d public_html thepathtozipfile yields a good extract with the correct index.php

Certainly, far from what I expected. The install now proceeds as normal it appears. What a waste of time!

BTW - it appears the zip was created on Windows, so, I did:

cd public_html
find . -type f -name '*php' -exec dos2unix {} ;

To get rid of the annoying ^M end of lines. Not required, but, they get in the way of editing.

18 Aug 2016, 4:49 AM
#17
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Installing a new site

Thanks for confirming that the problem was a bad download / unzip on your server.

No, we never build zips with Windows: it always messes them up.

One could also obtain a zip from github, but would have to do sha validation using their generated sha values instead of the ones on the ZC home page.