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?

2 Answers 2

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 /
2
  • After I relabel them, context always is set to user_home_t even if I change it to anything else....
    – Antonio
    Feb 12, 2013 at 18:22
  • 1
    Go find out who's messing with your system. Feb 12, 2013 at 18:23
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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .