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.zcObserve rLogWriterDatabase.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
Re: fatal error 1101 on fresh local install of 1.5.4
Quote:
Originally Posted by
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.zcObserve rLogWriterDatabase.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...
Re: fatal error 1101 on fresh local install of 1.5.4
Quote:
Originally Posted by
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.
Quote:
Originally Posted by
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.zcObserve rLogWriterDatabase.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:
Code:
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:
Code:
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)
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.
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?
Re: fatal error 1101 on fresh local install of 1.5.4
Quote:
Originally Posted by
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.
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:
Code:
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.