11. August 2017

Windows 10 displays different time after reboot from Linux

Using dual-boot Windows and Linux has several advantages. If one system fails to update, you can still work with the other one.

I experienced strange problem that Windows was always shifting the time about 2 hours after rebooting from Linux. One solution was to let Windows determine the time zone, but that worked until next reboot to Linux and back to Windows.

The solution that worked for me was to open regedit.exe and define following key as QWORD set to value 1:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\RealTimeIsUniversal

Then reboot the machine to Linux and back to Windows and everything was ok. No more time shifts.

Thanks to Ailurus for the solution.

17. June 2012

How to solve some problems with Drupal after upgrade to PHP 5.4

I’ve found several interesting issue after upgrading PHP 5.3 to PHP 5.4 on Drupal 6 and Drupal 7 sites.

The first biggest problem was that Drupal was displaying Access denied message on all web pages. It was not possible to login to system. Even http://localhost/?q=admin didn’t work.

I had to create temporary session. It is quite easy when using Drush:

drush user-login

Drush displayed one time session for admin. This solved the problem with admin login.

The other issue was that there was Access denied message on every page. There were also other very useful messages flooding each page:

Notice: Undefined index: access in function _menu_link_translate() …

I spent some time searching for any hint how to resolve this weird behavior. It was necessary to delete all Drupal’s caches.

Configuration -> Development -> Performance -> Delete cache

After this clean up Drupal was working correctly.

Then I checked one older Drupal 6 site and there was nice big red warning:

Warning: strtotime() [function.strtotime]: 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.

The problem was that there was no default timezone in php.ini. It was sufficient to add timezone to /etc/php5/apache2/php.ini to section

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "Europe/Prague"

You can find more info about timezones at php.net/date.timezone.

After reloading Apache configuration everything was ok.