Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.