Zen Cart Logo
Forums / Upgrading to 1.5.x / Admin Console and Shopping Cart are gone!

Admin Console and Shopping Cart are gone!

Views: 2,088

Results 1 to 19 of 19
7 Feb 2012, 1:23 PM
#1
Join Date:
Jan 2012
Posts:
15
Plugin Contributions:
0

Admin Console and Shopping Cart are gone!

SCREWED UP ROYALLY: ADMIN CONSOLE IS GONE!
:oops: I am very new to using Zen Cart v 1.5.0. After making many updates to my cart (it was almost ready for production), I made some kind of error at about midnight last night while performing an "innocent" update to the header image alternate text in one of the index.php files (can't remember exactly which one, but I'm almost positive it was the one that shows the Zen Cart/company logo in the upper left-hand corner of the Admin Console). Now when I go to where my Admin login screen should be, the screen is BLANK or occasionally returns in Internal Server error. My Admin Console is GONE and a completely white screen is all that shows up!!! A backup restore of the SQL database through my host was of no help, which doesn't surprise me since this is obviously a .php file issue, not a database issue. The iPage tech support representative stated the following: "I have tried to fix the issue and I was unable to fix it. The issue seems to be with the customization of the scripts. Hence, you need to contact the application provider to fix the issue." Well, I can't contact Zen Cart for help, so here I am. sigh

I'm so new to Zen Cart that I hadn't yet done a backup of the FTP files relating to my store (super dumb, I know!). I suspect that somewhere I accidentally overwrote the coding for one of the index.php files and now nothing relating to shopping cart is accessible. How can I find the original versions of each of the index.php files so that I can overwrite each of them until I can access my shopping cart again?? Or should I just reinstall Zen Cart and gasp! start over??? I'll be glad to live chat or even speak by phone with someone who knows how to help me. I am desperate to fix this issue ASAP. HELP!!! :cry:

7 Feb 2012, 1:31 PM
#2
stevesh avatar

stevesh

Black Belt

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

Re: Admin Console and Shopping Cart are gone!

Start here:

https://www.zen-cart.com/tutorials/index.php?article=82

and check your /cache folder for error log files.

The only index.php file you should be editing is in includes/languages/english. Sounds like you may have uploaded the edited file to admin/includes/languages/english by mistake.

7 Feb 2012, 1:58 PM
#3
Join Date:
Jan 2012
Posts:
15
Plugin Contributions:
0

Re: Admin Console and Shopping Cart are gone!

Thanks so much for replying, stevesh. I have located my cache folder and there are error logs galore, mostly from last night right before and after I noticed my issue. The problem is, they're all GREEK to me! The most recent one reads as follows:

[07-Feb-2012 02:56:34] PHP Warning: Cannot modify header information - headers already sent by (output started at /hermes/bosweb/web198/b1984/ipg.emjaynaturalbeautiqu/shop/zcadmin/includes/languages/english.php:1) in /hermes/bosweb/web198/b1984/ipg.emjaynaturalbeautiqu/shop/zcadmin/includes/init_includes/init_templates.php on line 28
[07-Feb-2012 02:56:34] PHP Warning: Cannot modify header information - headers already sent by (output started at /hermes/bosweb/web198/b1984/ipg.emjaynaturalbeautiqu/shop/zcadmin/includes/languages/english.php:1) in /hermes/bosweb/web198/b1984/ipg.emjaynaturalbeautiqu/shop/zcadmin/includes/functions/general.php on line 21

And the earliest error log from just before midnight, which I assume is when the issue started, reads as follows:

[06-Feb-2012 23:12:33] PHP Warning: Cannot modify header information - headers already sent by (output started at /hermes/bosweb/web198/b1984/ipg.emjaynaturalbeautiqu/shop/zcadmin/includes/languages/english.php:1) in /hermes/bosweb/web198/b1984/ipg.emjaynaturalbeautiqu/shop/zcadmin/includes/init_includes/init_templates.php on line 28

What in the world does that mean??? What can I do to restore the previous version of admin/includes/languages/english if I have no idea what it looked like before? Holy crap... :cry:

7 Feb 2012, 2:13 PM
#4
Join Date:
Jan 2012
Posts:
15
Plugin Contributions:
0

Re: Admin Console and Shopping Cart are gone!

STEVESH, IT WORKED!!!!!!!!!! Thank you! :D There were some spaces at the very beginning (i.e. line 1) of zcadmin/includes/languages/english.php. Once I removed them, everything came back and I'm able to log into my admin console. Now I just have to figure out why I'm getting a 500 Internal Server Error when I click on my Online Catalog, but I'm sure I'll figure it out shortly. Any ideas? :)

7 Feb 2012, 2:57 PM
#5
Join Date:
Jan 2012
Posts:
15
Plugin Contributions:
0

Re: Admin Console and Shopping Cart are gone!

Now my cache is recording the following error:

[07-Feb-2012 09:55:31] PHP Fatal error: Cannot redeclare zen_date_raw() (previously declared in /hermes/bosweb/web198/b1984/ipg.emjaynaturalbeautiqu/shop/includes/languages/english.php:30) in /hermes/bosweb/web198/b1984/ipg.emjaynaturalbeautiqu/shop/includes/languages/english/index.php on line 39

Obviously this relates to the 500 Internal Server Error that I get when I try to access the online catalog. Does anyone have any ideas on this??

7 Feb 2012, 3:31 PM
#6
Join Date:
Jan 2012
Posts:
15
Plugin Contributions:
0

Re: Admin Console and Shopping Cart are gone!

I'm using ZC v 1.5.0. How do I resolve the follow errors now being recorded in my cache?

[07-Feb-2012 09:55:31] PHP Fatal error: Cannot redeclare zen_date_raw() (previously declared in /hermes/bosweb/web198/b1984/ipg.emjaynaturalbeautiqu/shop/includes/languages/english.php:30) in /hermes/bosweb/web198/b1984/ipg.emjaynaturalbeautiqu/shop/includes/languages/english/index.php on line 39

This relates to the 500 Internal Server Error that I get whenever I try to access the online catalog. I first noticed this issue about an hour ago after resolving a "Warning: Cannot modify header information - headers already sent by" issue (thanks, stevesh!). I have looked at line 30 the english.php file, but I can't identify the issue. Does anyone have any ideas on this??:shocking:

7 Feb 2012, 3:49 PM
#7
Join Date:
Jan 2012
Posts:
15
Plugin Contributions:
0

Re: Admin Console and Shopping Cart are gone!

More info: I have highlighted "line 30" in red below:

// Return date in raw format
// $date should be in format mm/dd/yyyy
// raw date is in format YYYYMMDD, or DDMMYYYY
if (!function_exists('zen_date_raw')) {
function zen_date_raw($date, $reverse = false) { if ($reverse) {
return substr($date, 3, 2) . substr($date, 0, 2) . substr($date, 6, 4);
} else {
return substr($date, 6, 4) . substr($date, 0, 2) . substr($date, 3, 2);
}
}
}

What am I missing here?? This seems to be the correct string of coding required for this file, yet I'm getting a fatal error message that points to line 30 of this file. HELP??:wacko:

7 Feb 2012, 8:09 PM
#8
drbyte avatar

drbyte

Sensei

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

Re: Admin Console and Shopping Cart are gone!

Looks like your english.php and index.php have been significantly altered from what the original code contains.
Start with original versions of those files, and then apply ONLY YOUR customizations to the files.

7 Feb 2012, 8:18 PM
#9
Join Date:
Jan 2012
Posts:
15
Plugin Contributions:
0

Re: Admin Console and Shopping Cart are gone!

Thanks! Now I've got a really dumb question (don't laugh at me): Where would I find/access the original versions of those files? I first accessed Zen Cart through iPage's SimpleScripts page, if that matters. Is there a way to find the files again, and then would a simple "overwrite" of one file in place of another do the trick?

Also, just for the sake of curiosity and learning, what did you see in that code string that helped you come to the conclusion that BOTH files have been compromised? I've got to understand this! :)

Signed,
Seeing a light at the end of the tunnel LOL

7 Feb 2012, 8:28 PM
#10
stevesh avatar

stevesh

Black Belt

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

Re: Admin Console and Shopping Cart are gone!

Download and unzip the Zencart .zip file at zen-cart.com and copy that file from the required folders/files.

Using your host's installer usually works, but you learn so much more by installing manually.

7 Feb 2012, 8:37 PM
#11
gjh42 avatar

gjh42

Black Belt

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

Re: Admin Console and Shopping Cart are gone!

Also, auto-installers like fantastico usually require you to install Zen Cart in a subfolder instead of in your domain root, which is where you would normally want the store (immediately accessible to customers). Installing manually allows you to specify the exact location, and really doesn't take any more computer knowledge than auto-installers (unless they create the database for you, leaving you totally in the dark about your critically important database).
You can use your hosting control panel to create the database without knowing anything about how it works, but you will then have a clue about where to look if something goes wrong.

7 Feb 2012, 8:41 PM
#12
Join Date:
Jan 2012
Posts:
15
Plugin Contributions:
0

Re: Admin Console and Shopping Cart are gone!

stevesh, that sounds almost too easy--I think I could actually do that! Dare I dream that this nightmare could be over soon??

So what you're saying is...once I download the Zencart zip file onto my computer's hard drive, I just need to find those two files (i.e. english.php and index.php) in their respective folders within the zip file and copy them into the right folders on my FTP server (i.e. includes/languages and includes/languages/english), overwriting the two damaged files in the process? I hope that's what you meant because that was my understanding. lol I'll keep you posted...

gjh42, will you please elaborate on your comments about auto-installers? I assume that's what I used by going through SuperScripts, but I'm not sure if that's what you're referring to. My main Zen Cart "shop" folder is located as a Directory under the FTP root at ftp.site.com. Is that right??

Signed,
Hope can be cruel =)

7 Feb 2012, 8:46 PM
#13
gjh42 avatar

gjh42

Black Belt

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

Re: Admin Console and Shopping Cart are gone!

You've got it right:)

7 Feb 2012, 9:17 PM
#14
Join Date:
Jan 2012
Posts:
15
Plugin Contributions:
0

Re: Admin Console and Shopping Cart are gone!

I CAN BREATHE AGAIN!!!!!!!!! THANK YOU TO STEVESH, DRBYTE, AND GLH42 for pulling me back from the precipice!!! After replacing those two files with new ones from a fresh Zen Cart zip download, my shopping cart is back and good as new! :clap:

NOW...Will somebody PLEASE tell me that most efficient way to back up my Zen Cart database and files so that I can do it every two seconds from now on?? LOL I'm somewhat familiar with backing up the MySQL database after last night's ordeal (but not very much), and definitely not so much with the FTP files side of it. Is it just a matter of copying the entire folder of FTP files into a location on my computer, or is there more involved than that? How often is often enough? Any advice is appreciated because I plan on backing up everything in a few hours.

Thanks again to my new online friends. Please forward me your phone numbers so I can put you on speed dial! lol j/k

EmJayNaturalBeautiqu

7 Feb 2012, 9:33 PM
#15
gjh42 avatar

gjh42

Black Belt

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

Re: Admin Console and Shopping Cart are gone!

My main Zen Cart "shop" folder is located as a Directory under the FTP root at ftp.site.com. Is that right?? Not 100% certain of what you have from this description, but if customers reach the store by https://www.yourdomain.com/shop/, that is what I was talking about. There is usually no good reason to put the store and your products one click deeper in your site - let them at it as fast as possible! :)

7 Feb 2012, 9:54 PM
#16
Join Date:
Jan 2012
Posts:
15
Plugin Contributions:
0

Re: Admin Console and Shopping Cart are gone!

Yes, that's what I meant: https://www.mydomain.com/shop/ is where the store's home page is. When I was using my prior shopping cart, that's where it was automatically installed, so when I installed Zen Cart, it seemed like the most logical place for it. :clap:

7 Feb 2012, 10:41 PM
#17
gjh42 avatar

gjh42

Black Belt

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

Re: Admin Console and Shopping Cart are gone!

So you had an index.html in https://www.mydomain.com/ that pointed visitors to the store? Unless you have a compelling reason to make users go through/past other content first, it would be better to have the store directly in https://www.mydomain.com/.

8 Feb 2012, 2:07 AM
#18
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: Admin Console and Shopping Cart are gone!

Is it just a matter of copying the entire folder of FTP files into a location on my computer

For doing a complete backup, yes. When doing individual file edits, just backup the original before editing.

Also, make sure you are using the overrides system. Tutorial here: https://www.zen-cart.com/tutorials/index.php?article=36

8 Feb 2012, 11:36 AM
#19
stevesh avatar

stevesh

Black Belt

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

Re: Admin Console and Shopping Cart are gone!

EmJayNaturalBeautiqu:

NOW...Will somebody PLEASE tell me that most efficient way to back up my Zen Cart database and files so that I can do it every two seconds from now on?? Is it just a matter of copying the entire folder of FTP files into a location on my computer, or is there more involved than that? How often is often enough? .

I use the Export function in phpMyAdmin to save a copy of the database to my local machine, then immediately copy it to a USB drive.

For the files, I use the Compress function in CPanel's File Manager, then download the zip file and copy it, too, to the USB drive.

I think how often depends on your site and how much business you're doing. I have one site (with forum and blog) that I back up three times a day. My (excellent) host also backs everything (files and DB) every 24 hours.