Forums / Upgrading to 1.5.x / Config Files for Admin

Config Files for Admin

Views: 2,226

Results 1 to 13 of 13
9 Apr 2013, 3:52 PM
#1
gcopping avatar

gcopping

New Zenner

Join Date:
Jan 2010
Posts:
80
Plugin Contributions:
0

Config Files for Admin

I am upgrading from 1.3.9h to 1.5.1 and have got the db uploaded and changed the configure.php files. I can browse to the web site but I cannot browse to the Admin log on I just get the message:

WARNING: An Error occurred, please refresh the page and try again.

I have double checked the db configures and they are the same as the db configure.php for the web site. So I think I may have a directory problem.

If my Admin directory is https://www.website.com/zencart/admin123 then I am a bit confused as to what should go in the following:

define('DIR_WS_ADMIN', preg_replace('#^' . str_replace('-', '-', $p1) . '#', '', dirname($_SERVER['SCRIPT_NAME'])) . '/');

define('DIR_WS_CATALOG', '/zencart/');

define('DIR_WS_HTTPS_ADMIN', preg_replace('#^' . str_replace('-', '-', $p2) . '#', '', dirname($_SERVER['SCRIPT_NAME'])) . '/');

define('DIR_WS_HTTPS_CATALOG', '/zencart/');

and

define('DIR_FS_ADMIN', realpath(dirname(FILE) . '/../') . '/');

define('DIR_FS_CATALOG', '/home/website/public_html/zencart/');

I have tried adding 'admin123' in the 3 places following 'zencart' above but then I just get a blank screen when pointing to the Admin Login page.

Can anyone please help with this?

10 Apr 2013, 3:08 AM
#3
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Config Files for Admin

then I am a bit confused as to what should go in the following:

define('DIR_WS_ADMIN', preg_replace('#^' . str_replace('-', '\-', $p1) . '#', '', dirname($_SERVER['SCRIPT_NAME'])) . '/');

This is code that automatically gets the name of your secret_admin folder.
And doesn't need any changing.

Zen-Venom Get Bitten

10 Apr 2013, 8:14 AM
#4
gcopping avatar

gcopping

New Zenner

Join Date:
Jan 2010
Posts:
80
Plugin Contributions:
0

Re: Config Files for Admin

Thanks for your help.

OK I have checked the log files and it appears the problem is with a table called 'dbprefix'_admin_pages not existing.

I have checked my db with PHPMyAdmin and it certainly isn't there, but my db is a restore of a 1.3.9h version and that table doesn't exist there either.

So please what do I do next?

10 Apr 2013, 11:54 AM
#5
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Config Files for Admin

That table does exist in a stock Zencart installation (1.5.1). My guess is that it's part of the Admin Profiles function that was added to 1.5 and it sounds like you restored a 1.3.9 DB, but the 1.5 files are still looking for that table. You may nave to upgrade your DB to 1.5.

10 Apr 2013, 12:46 PM
#6
gcopping avatar

gcopping

New Zenner

Join Date:
Jan 2010
Posts:
80
Plugin Contributions:
0

Re: Config Files for Admin

Yes you are correct so then the question is how do I upgrade the db tables when I can't get access to the Admin function?

10 Apr 2013, 1:48 PM
#7
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Config Files for Admin

gcopping:

Yes you are correct so then the question is how do I upgrade the db tables when I can't get access to the Admin function?
From the Zen Cart FAQ: How do I upgrade my site. Note steps 8+

Another Upgrade Method: How Do I Rebuild My Site On The New Version.

The glass is not half full. The glass is not half empty. The glass is simply too big!
Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

10 Apr 2013, 2:03 PM
#8
gcopping avatar

gcopping

New Zenner

Join Date:
Jan 2010
Posts:
80
Plugin Contributions:
0

Re: Config Files for Admin

OK but when it says "run zc_install" I don't understand where I run it from. I thought these scripts were run from within the Admin function but if I can't get into the Admin function then where do I run the script from?

10 Apr 2013, 2:55 PM
#9
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Config Files for Admin

You run zc_install by navigating to that folder URL in your browser.
https://www.yoursite.com/zc_install/
assuming you have Zen Cart residing in the domain root.
Or if it is in a subfolder
https://www.yoursite.com/your_zencart_folder/zc_install/

This requires that you (still) have the zc_install folder on your site. It needs to be deleted after installation/upgrading is completed.

10 Apr 2013, 3:47 PM
#10
gcopping avatar

gcopping

New Zenner

Join Date:
Jan 2010
Posts:
80
Plugin Contributions:
0

Re: Config Files for Admin

OK thanks now I understand, I appreciate your help.

However I have installed 1.5.1 from my hosting company and it does not contain the folder zc_install. Therefore I have downloaded 1.5.1 from the ZenCart site and ftp'd the folder across.

When I run it I get a warning that the file /admin/includes/configure.php does not exist - it will not because my installation does not have a folder called 'admin' but an admin folder named with a long list of letters and numbers automatically created by my hosting company installation of 1.5.1

Therefore do I need to change this folder name back to 'admin' to run zc_install and then change it back afterwards? Are there any other implications of doing this, or should I be doing it another way?

10 Apr 2013, 4:07 PM
#11
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Config Files for Admin

gcopping:

I am upgrading from 1.3.9h to 1.5.1 ... However I have installed 1.5.1 from my hosting company and it does not contain the folder zc_install. Therefore I have downloaded 1.5.1 from the ZenCart site and ftp'd the folder across.
I would recommend starting over with the upgrade, not using the hosting companies "script", and following the procedures listed in the Zen Cart documentation. There are a number of things which need to happen for an "upgrade" to be successful and using the upgrade process supplied by the developers of Zen Cart usually works best (and is the least painful).

Yes you can probably temporarily rename the admin back to "/admin"... As this will let Zen Cart use your existing configure.php files. But I would make sure you are operating on a "clone" of the original site instead of the live website... In case anything goes wrong...

If you used a script from the hosting provider to "upgrade", there may be other problems... And it may be faster to just download the distribution from Zen Cart directly and start the upgrade process over... Following the outlined process (and using a different database / location until the upgraded site is ready to go). Alternatively you could try to contact your hosting provider and have them fix things...

The glass is not half full. The glass is not half empty. The glass is simply too big!
Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

11 Apr 2013, 11:45 AM
#12
gcopping avatar

gcopping

New Zenner

Join Date:
Jan 2010
Posts:
80
Plugin Contributions:
0

Re: Config Files for Admin

Thanks for the reply - I wish the info about preferably not using a web hosts script had been in the documentation it might have save me a lot of time.

I am working on a clone of the site and am not using the web hosts script to upgrade. I have started with a new copy of 1.5.1 and am then customising as per the original version of the site, and then restoring the 1.3.9h db into this new version.

I don't want to start over as I have already spent about 12 hours on this project and still don't have a new version to test. So I will try changing the name of the admin folder and move on from there, unless anyone tells me that this won't work.

11 Apr 2013, 1:10 PM
#13
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Config Files for Admin

gcopping:

I am working on a clone of the site and am not using the web hosts script to upgrade. I have started with a new copy of 1.5.1 and am then customising as per the original version of the site, and then restoring the 1.3.9h db into this new version. ... So I will try changing the name of the admin folder and move on from there, unless anyone tells me that this won't work.
Ahh, good - no host provided "upgrade script" - just an installer (possibly with some minor modifications). I'd give the "folder rename" + "database upgrade only" a good chance of working for you in that case. After the DB upgrade, you might need to re-run the "install" for any installed Zen Cart modules which made database changes. About the only big gotcha I remember.

crosses fingers Let us know how it goes!

The glass is not half full. The glass is not half empty. The glass is simply too big!
Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker