0

I installed wordpress to CentOS from EPEL:

yum install wordpress

And it can only work if I manually disable SELinux. Otherwise I see this error:

PHP Fatal error: date(): Timezone database is corrupt - this should never happen! in /usr/share/wordpress/wp-includes/functions.php on line 105, referer: http://www.myblog.com/wp-admin/

ls -Z /usr/share/zoneinfo
drwxr-xr-x. root root system_u:object_r:user_home_t:s0 Africa
drwxr-xr-x. root root system_u:object_r:user_home_t:s0 America
drwxr-xr-x. root root system_u:object_r:user_home_t:s0 Antarctica
drwxr-xr-x. root root system_u:object_r:user_home_t:s0 Arctic
drwxr-xr-x. root root system_u:object_r:user_home_t:s0 Asia
drwxr-xr-x. root root system_u:object_r:user_home_t:s0 Atlantic
...
(many lines skipped)

How can I fix this?

Antonio
  • 720
  • 4
  • 13
  • 29

2 Answers2

0

Once again your files have the wrong SELinux security contexts. This is the same problem you had before.

At this point I suggest you relabel, not only the immediately affected files, but the entire filesystem.

restorecon -r -v /
Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
0

In addition to restorecon, you might need to get SELinux context survive a file system relabel, using the semanage command -

eg.

 semanage fcontext -a -t locale_t /usr/share/zoneinfo
 semanage fcontext -a -t locale_t /usr/share/zoneinfo/Africa

Read the RedHat documentation for making persistent changes using semanage.

Daniel t.
  • 9,291
  • 1
  • 33
  • 36