If this is your first visit, check our documentation. To post, register or login.
Forums / Upgrading from 1.3.x to 1.3.9 / Weird characters & blank pages all of a sudden ()

Weird characters & blank pages all of a sudden ()

Locked

Started by thenoob on 29 Mar 2011, 8:32 PM · Views: 6,075

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
29 Mar 2011, 8:32 PM
#1
thenoob avatar

thenoob

New Zenner

Join Date:
Mar 2011
Posts:
4
Plugin Contributions:
0

Weird characters & blank pages all of a sudden ()

Hi!

I've searched the FAQs and forums, tried every solution I found or could think of and I couldn't solve this problem. I even contacted my hosting company and they couldn't find a solution either (they actually suggested me I choose another cart program - which I don't want to do after the countless hours of hard work I put into my website).

The problem:

Weird characters (like these:  ) have begun appearing in my French site pages and in my French admin login at the same time I could not connect to my admin anymore (got a blank page). I went around the problem (my host found this for me) by logging in in English but as soon as I switch to French (once I'm logged in - I also receive a message form my browser that the information I'm about to send will not be secured when I make the switch to French so is my problem SSL-related?) and save a modification to a page I get the blank screen again and can't connect to admin until I clear my browser's (Firefox) cache. I tried on multiple computers with different browsers by the way.

What I know or found out so far:

I've had this website for about 6 months. I did the upgrade to Zen Cart v1.3.9h as soon as I found out it was available (about 2-3 months ago?). Everything has ever worked just fine!

The last time I logged in to my admin was to add new products on March 25. On March 26 all Hell broke loose when I tried to log in.

Here's the content of a file I found on my server named "error_log" at the location ".../store/" :

[26-Mar-2011 06:33:24] PHP Warning: Module 'PDO' already loaded in Unknown on line 0
[26-Mar-2011 06:33:24] PHP Warning: Module 'pdo_sqlite' already loaded in Unknown on line 0
[26-Mar-2011 06:33:24] PHP Warning: Module 'SQLite' already loaded in Unknown on line 0
[26-Mar-2011 06:33:24] PHP Warning: Module 'pdo_mysql' already loaded in Unknown on line 0
[26-Mar-2011 06:33:24] PHP Fatal error: [Zend Optimizer] Extension "Zend Optimizer" cannot be loaded twice in Unknown on line 0

Here's the content of the latest in a long series of debug files (found in the "cache" directory):

[29-Mar-2011 14:26:09] PHP Warning: Cannot modify header information - headers already sent by (output started at /store/admin/includes/languages/french.php:1) in /store/admin/includes/init_includes/init_templates.php on line 28
[29-Mar-2011 14:26:09] PHP Warning: Cannot modify header information - headers already sent by (output started at /store/admin/includes/languages/french.php:1) in /store/admin/includes/functions/general.php on line 21

Please take note that I hid the beginning of the path for security reasons.

In one of our many email exchanges, my host's rep told me the problem might have been caused by a PHP uograde they ran around that date (then I guess he got tired of trying to figure out my problem 'cause he said the problem was with Zen Cart not being secure, etc...).

The PHP version I use is 5.2.17 so it is above 5.2.3 and should run fine with Zen Cart v1.3.9h right?

CHARSET is set to "iso-8859-1" in all the files I checked.

Well, I know it's a long post and I will appreciate any help anyone can bring.

Thank you for your time and patience if you decide to try and help me!

30 Mar 2011, 3:02 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: Weird characters & blank pages all of a sudden ()

TheNoob:

Weird characters (like these:  ) have begun appearing in my French site pages and in my French admin login at the same time I could not connect to my admin anymore (got a blank page).Those look like BOM (Byte Order Mark) characters, which are being added to your files when you edit them because your text-editor's settings are set to "add BOM when saving".
When working with programming scripts and files that drive webserver operation, you DO NOT want BOM on your files.
You need to change your settings so your editor saves the files "without BOM".

TheNoob:

Here's the content of a file I found on my server named "error_log" at the location ".../store/" :

[26-Mar-2011 06:33:24] PHP Warning: Module 'PDO' already loaded in Unknown on line 0
[26-Mar-2011 06:33:24] PHP Warning: Module 'pdo_sqlite' already loaded in Unknown on line 0
[26-Mar-2011 06:33:24] PHP Warning: Module 'SQLite' already loaded in Unknown on line 0
[26-Mar-2011 06:33:24] PHP Warning: Module 'pdo_mysql' already loaded in Unknown on line 0
[26-Mar-2011 06:33:24] PHP Fatal error: [Zend Optimizer] Extension "Zend Optimizer" cannot be loaded twice in Unknown on line 0None of those are Zen Cart issues. You should bring them to the attention of your hosting company so they can address them.

TheNoob:

Here's the content of the latest in a long series of debug files (found in the "cache" directory):

[29-Mar-2011 14:26:09] PHP Warning: Cannot modify header information - headers already sent by (output started at /store/admin/includes/languages/french.php:1) in /store/admin/includes/init_includes/init_templates.php on line 28
[29-Mar-2011 14:26:09] PHP Warning: Cannot modify header information - headers already sent by (output started at /store/admin/includes/languages/french.php:1) in /store/admin/includes/functions/general.php on line 21
Again, that's pointing to "line 1 of french.php" having extra characters before the beginning "<?php" tag, and the BOM is what'll be there ... most likely invisible to you within your text editor. But if you open it with your text editor and tell it to save the file "without BOM", then it should fix the problem.
TheNoob:

The PHP version I use is 5.2.17 so it is above 5.2.3 and should run fine with Zen Cart v1.3.9h right?
Yes.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

30 Mar 2011, 10:22 AM
#3
thenoob avatar

thenoob

New Zenner

Join Date:
Mar 2011
Posts:
4
Plugin Contributions:
0

Re: Weird characters & blank pages all of a sudden ()

Thank you for the prompt reply!

I already sent the PHP warnings and fatal error to my host because I thought it was pretty obvious that this had something to do with their PHP update they told me they ran around the 26th but I will sent it to them again with a copy of your post.

I use notepad to edit my PHP files. How do I save without BOM? Is it by switching the encoding to UTF-8? The thing is that everything was working fine before and I never changed the encoding or anything else before saving a file.

I think I'll wait for my host to fix the PHP warnings and errors before changing anything else to see what happens.

Once again: THANK YOU VERY MUCH!!!

30 Mar 2011, 10:30 PM
#4
thenoob avatar

thenoob

New Zenner

Join Date:
Mar 2011
Posts:
4
Plugin Contributions:
0

Re: Weird characters & blank pages all of a sudden ()

My host deleted BOMs but nothing works...

Here's something new I found online, can someone tell me if it might work please? I mean I know I could just try it to see if it works but I seem to remember having read somewhere that coding had to be "ansi" with Zen Cart v1.3.9h (or maybe I just dreamt it?).

Here's what I found:

Recently I came across the issue of funny character for one of our client websie developed in Zen Cart. I have searched almost more than 10+ forums including zen cart forums. But couldnt find the root of the issue. But I have found out the issue from one site that that might be character encoding issue.

Zen cart settings was for Latin 8859 – 1 which was the root of the issue of funny character.

I have set up UTF-8 Unicode character set encoding for 3 files and it works like a charm.

I have made changes in 3 files.

  1. includes/languages/YOUR_LANGUAGE.php

Change Line @setlocale(LC_TIME, ‘en_US.ISO_8859-1′); To @setlocale(LC_TIME, ‘en_US.utf8′);

and Change Line define(‘CHARSET’, ‘iso-8859-1′); To define(‘CHARSET’, ‘utf-8′);

  1. admin/includes/languages/YOUR_LANGUAGE.php

Change Line define(‘CHARSET’, ‘iso-8859-1′); To define(‘CHARSET’, ‘utf-8′);

  1. includes/classes/db/mysql/query_factory.php

Find out if (@mysql_select_db($zf_database, $this->link)) in that if function replace $this->db_connected = true; return true;

with
view source
print?
01 if (version_compare(mysql_get_server_info(), '4.1.0', '>=')) {
02 mysql_query('SET NAMES "utf8"', $this->link);
03 $this->db_connected = true;
04
05 return true;
06
07 } else {
08
09 $this->set_error(mysql_errno(),mysql_error(), $zp_real);
10
11 return false;
12
13 }

  1. You need to Change Character settings in Database.

Go To PhpMyAdmin > Select Database > Operations > Collation Dropdown – Select utf8_general_ci and press Go.

Now, you have set character set in Zen cart, MySql Database but you need to check that actually they are active or not..

For that There are two process to check character set of a webpage.

  1. Mozilla Firefox – Go to View > Character Encoding > Check ( Unicode Utf- 8 ) is selected or not. If selected then you can say that your page is set to utf-8 encoding.

  2. Viewsource of sites index page.

go to site and on Mozill View > Page source ( or Press Ctrl + U ) and check that meta charactor encoding is set to utf-8 or not.

Thanks,

Hope this helps….

I am seriously thinking about dropping the web site altogether... I really don't have time for this!!

30 Mar 2011, 10:36 PM
#5
thenoob avatar

thenoob

New Zenner

Join Date:
Mar 2011
Posts:
4
Plugin Contributions:
0

Re: Weird characters & blank pages all of a sudden ()

Me again...

Since the problem is only with the French version of my site, what would happen if I simply deleted the French language pack and re-installed it? Would I loose all French data (products descriptions) from the database or just the defined pages or what?

Thanks!

7 Apr 2011, 4:18 AM
#6
drbyte avatar

drbyte

Sensei

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

Re: Weird characters & blank pages all of a sudden ()

TheNoob:

I use notepad to edit my PHP files.Bad choice. Better to use NotePad++ (http://notepad-plus.sf.net )
TheNoob:

How do I save without BOM? Is it by switching the encoding to UTF-8?In more reliable editor apps, like NotePad++, there's an option in the menu to save without BOM.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

7 Apr 2011, 4:20 AM
#7
drbyte avatar

drbyte

Sensei

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

Re: Weird characters & blank pages all of a sudden ()

TheNoob:

Since the problem is only with the French version of my site, what would happen if I simply deleted the French language pack and re-installed it?If you simply delete the files for it, and re-upload those, then it won't affect your store's product data at all. > TheNoob:

Would I loose all French data (products descriptions) from the database or just the defined pages or what?Since the define-pages are stored in the php files, you'll need to preserve those before deleting and replacing the language files.
But the product descriptions will be preserved in the database. The only way you'll lose those if if you go into Admin->Localization->Languages and click Delete on that language entry. So, don't do that.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

14 Nov 2011, 3:41 PM
#8
tamya avatar

tamya

Zen Follower

Join Date:
Feb 2007
Posts:
336
Plugin Contributions:
0

Re: Weird characters & blank pages all of a sudden ()

I did not want to start another thread for this question and i think this thread is a perfect place for it.

I was able to clean the database from â€, ‡, “, etc. based on a post on the internet to what each of these similes is equivalent to.

The character 'Â' is giving me a hard time, when i search the store for this characters then it will show every listing that has any of the following (a, A or Â), so if i replace the extra character with space or nothing then the all the a's will be removed from the database.

Any suggestion on how to go around this? Thanks in advance.

14 Nov 2011, 6:41 PM
#9
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: Weird characters & blank pages all of a sudden ()

Download your database and open it with your HTML or Text Editor. Do a Search & Replace for  replacing it with a blank space or nothing. Save file and Import changed database.

Note:

  • make sure your site is in Maintenance mode while doing this
  • keep an unaltered backup of the database in case your changes don't work right

The learning is in the doing.

Potent Products

14 Nov 2011, 9:17 PM
#10
tamya avatar

tamya

Zen Follower

Join Date:
Feb 2007
Posts:
336
Plugin Contributions:
0

Re: Weird characters & blank pages all of a sudden ()

Thanks Website Rob, i will give that a try.