Zen Cart Logo
Forums / Installing on a Windows Server / fatal error 1101 on fresh local install of 1.5.4

fatal error 1101 on fresh local install of 1.5.4

Locked

Views: 4,662

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
3 Jan 2015, 8:23 PM
#1
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

fatal error 1101 on fresh local install of 1.5.4

Hi,

I downloaded v.1.5.4, and tried installing on local server, after the needed configuration of Apache, and PHP, all went thru well (all green), can access store fine, but when trying to go to admin I get:
WARNING: An Error occurred, please refresh the page and try again.

The log file reads:
[03-Jan-2015 20:12:52 UTC] PHP Fatal error: 1101:BLOB/TEXT column 'logmessage' can't have a default value :: ALTER TABLE admin_activity_log ADD COLUMN logmessage mediumtext NOT NULL default '' ==> (as called by) C:\Users\PC\sites\AAAhtdocs\zentest\admin\includes\classes\class.admin.zcObserverLogWriterDatabase.php on line 90 <== in C:\Users\PC\sites\AAAhtdocs\zentest\includes\classes\db\mysql\query_factory.php on line 155

Also there is an install warning log:
[03-Jan-2015 20:12:19 UTC] PHP Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in C:\Users\PC\sites\AAAhtdocs\zentest\zc_install\includes\application_top.php on line 59

Thank you

3 Jan 2015, 8:41 PM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: fatal error 1101 on fresh local install of 1.5.4

keneso:

Hi,

I downloaded v.1.5.4, and tried installing on local server, after the needed configuration of Apache, and PHP, all went thru well (all green), can access store fine, but when trying to go to admin I get:
WARNING: An Error occurred, please refresh the page and try again.

The log file reads:
[03-Jan-2015 20:12:52 UTC] PHP Fatal error: 1101:BLOB/TEXT column 'logmessage' can't have a default value :: ALTER TABLE admin_activity_log ADD COLUMN logmessage mediumtext NOT NULL default '' ==> (as called by) C:\Users\PC\sites\AAAhtdocs\zentest\admin\includes\classes\class.admin.zcObserverLogWriterDatabase.php on line 90 <== in C:\Users\PC\sites\AAAhtdocs\zentest\includes\classes\db\mysql\query_factory.php on line 155

Also there is an install warning log:
[03-Jan-2015 20:12:19 UTC] PHP Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in C:\Users\PC\sites\AAAhtdocs\zentest\zc_install\includes\application_top.php on line 59

Thank you

I've found errors like that relate to the mysql installation, particularly when working on a windows server. I have often corrected by modifying table settings or sql for the applicable problem field/table. Or if necessary settings in the mysql database to allow such "default" setting against a BLOB/TEXT column for example...

3 Jan 2015, 10:16 PM
#3
lhungil avatar

lhungil

Totally Zenned

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

Re: fatal error 1101 on fresh local install of 1.5.4

keneso:

... PHP Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in C:\Users\PC\sites\AAAhtdocs\zentest\zc_install\includes\application_top.php on line 59 ...
This indicates you have not configured your timezone in "php.ini" (in your local development server). This is now required by a number of internal PHP functions (PHP 5.3+) and the error message is coming from PHP itself.

Alternatively (if this message is received on a hosted server and the hosting company cannot / will not / does not allow updating "php.ini"), one can edit "/includes/extra_configures/set_time_zone.php" to add the correct timezone. Be aware this should only be used as a last resort.

keneso:

... PHP Fatal error: 1101:BLOB/TEXT column 'logmessage' can't have a default value :: ALTER TABLE admin_activity_log ADD COLUMN logmessage mediumtext NOT NULL default '' ==> (as called by) C:\Users\PC\sites\AAAhtdocs\zentest\admin\includes\classes\class.admin.zcObserverLogWriterDatabase.php on line 90 ...
MySQL does not allow setting a default on TEXT or BLOB fields, so this may be a minor bug in the code. Probably was missed because many production MySQL servers are configured to ignore rather than report this error.

Starting in "/admin/includes/classes/class.admin.zcObserverLogWriterDatabase.php" around line 87 change the following code:

from:

    if (!$found_logmessage)
    {
      $sql = "ALTER TABLE " . TABLE_ADMIN_ACTIVITY_LOG . " ADD COLUMN logmessage mediumtext NOT NULL default ''";
      $db->Execute($sql);
    }
    // add 'severity' field of type varchar(9)

to:

    if (!$found_logmessage)
    {
      $sql = "ALTER TABLE " . TABLE_ADMIN_ACTIVITY_LOG . " ADD COLUMN logmessage mediumtext NOT NULL;
      $db->Execute($sql);
    }
    // add 'severity' field of type varchar(9)
3 Jan 2015, 10:48 PM
#4
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: fatal error 1101 on fresh local install of 1.5.4

Thank you both.

@lhungil

Without your detailed solution I wouldn't have solved it.

3 Jan 2015, 11:50 PM
#5
drbyte avatar

drbyte

Sensei

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

Re: fatal error 1101 on fresh local install of 1.5.4

What version of PHP and MySQL are you using?
And what version of Windows on your local PC?

4 Jan 2015, 12:12 AM
#6
keneso avatar

keneso

Totally Zenned

Join Date:
May 2009
Posts:
1,273
Plugin Contributions:
3

Re: fatal error 1101 on fresh local install of 1.5.4

DrByte:

What version of PHP and MySQL are you using?
And what version of Windows on your local PC?

httpd-2.4.10-win64-VC11
php-5.6.4-Win32-VC11-x64
mysql-web-community-5.6.22.0
Windows 8.1 64-bit

I did the "standard" installs, not selecting any particular option as I can remember, only problem was with phpMyAdmin.

4 Jan 2015, 12:50 AM
#7
lhungil avatar

lhungil

Totally Zenned

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

Re: fatal error 1101 on fresh local install of 1.5.4

I've been able to duplicate this under MySQL 5.5 and 5.6 when STRICT_ALL_TABLES is enabled in MySQL (Windows and Linux). The binary compilations (from Oracle) do not enable this mode by default (according to the documentation).

When not enabled, MySQL 5.5 and 5.6 appear to just create the column as if no default was specified. "SHOW CREATE TABLE admin_activity_log" shows the following after creation without STRICT_ALL_TABLES enabled:

CREATE TABLE `admin_activity_log` (
  `log_id` bigint(15) NOT NULL AUTO_INCREMENT,
  `access_date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  `admin_id` int(11) NOT NULL DEFAULT '0',
  `page_accessed` varchar(80) NOT NULL DEFAULT '',
  `page_parameters` text,
  `ip_address` varchar(45) NOT NULL DEFAULT '',
  `flagged` tinyint(4) NOT NULL DEFAULT '0',
  `attention` varchar(255) NOT NULL DEFAULT '',
  `gzpost` mediumblob,
  `logmessage` mediumtext NOT NULL,
  `severity` varchar(9) NOT NULL DEFAULT 'info',
  PRIMARY KEY (`log_id`),
  KEY `idx_page_accessed_zen` (`page_accessed`),
  KEY `idx_access_date_zen` (`access_date`),
  KEY `idx_flagged_zen` (`flagged`),
  KEY `idx_ip_zen` (`ip_address`),
  KEY `idx_severity_zen` (`severity`)
) ENGINE=MyISAM

NOTE: COLLATE, CHARSET, and the current AUTO_INCREMENT values were removed from the above table structure dump.