Red Hat Bugzilla – Bug 826623
PHP 5.4.3 breaks Wordpress: "Cannot redeclare create_initial_post_types()"
Last modified: 2013-07-03 19:15:55 EDT
I was notified that my 'site appears to be down'. Checking, my frontpage (which is Wordpress) was showing up blank, and I saw this error repeated every time anyone tried to access it, in error.log:
PHP Fatal error: Cannot redeclare create_initial_post_types() (previously declared in /usr/share/wordpress/wp-includes/post.php:20) in /usr/share/wordpress/wp-includes/post.php on line 152
Checking history the only relevant update seemed to be https://admin.fedoraproject.org/updates/FEDORA-2012-7628/php-5.4.3-1.fc17,maniadrive-1.2-40.fc17 . yum downgrade confirms this. After downgrading to php-5.4.1-1.fc17.x86_64 , my WP install works fine again.
So something between PHP 5.4.1 and PHP 5.4.3 makes it complain about a Wordpress PHP file it was perfectly happy with before. I'll attach the relevant .php file, for convenience. Oddly, I can't find any reports of this in either upstream bug tracker, though you'd have thought it'd be caught by now.
Created attachment 587770 [details]
The offending PHP file
What version of wodrespss are you using?
I just did a wordpress install & could create a page using:
Have you got any changes to the default php.ini, wordpress config, or similar?
(Apologies for my inability to type "wordpress" there)
(In reply to comment #2)
> Have you got any changes to the default php.ini, wordpress config, or
rpm -V php wordpress
says? (and attach php.ini and wordpress/config.php as well, please)
The only things I've changed in wordpress config are the database login details.
In php.ini, I've changed the max_execution_time to 3600 (this is to do with an issue in tt-rss) but that's all. I also have php-pecl-apc installed; I haven't tried it without that, yet.
The other factor is that I do have several Wordpress extensions installed: akismet, bad_behavior, janrain engage (rpx), browserid, wp-dbmanager, wp-mail-smtp, wp-recaptcha, wptouch, xrds-simple. I guess I'll have to try disabling each of those too. Sigh.
Have you "reload" apache after wordpress update ?
I have notice that sometime, APC cache get corrupted when file are updated (with older version than current time, I think) This should need more investigation.
(In reply to comment #6)
> The other factor is that I do have several Wordpress extensions installed:
> akismet, bad_behavior, janrain engage (rpx), browserid, wp-dbmanager,
> wp-mail-smtp, wp-recaptcha, wptouch, xrds-simple. I guess I'll have to try
> disabling each of those too. Sigh.
I think that would be best ... of course, you can also try just today's fresh built of 3.4 RC3 from Rawhide (I trust, you can make a scratch build for your Fedora).
Also, I have a lot of bad experience with php-eaccelerator and similar caches. If you use some, switch them off.
Of course, some error messages from log would be helpful ... the one you mentioned is nowhere to be found.
That was basically the only useful error.
I'll poke it a bit more and come back. apc is a cache similar to eaccelerator, but I've never had issues with it before and I really need it - without it, the server rapidly exhausts the RAM available to it.
(In reply to comment #9)
> That was basically the only useful error.
> I'll poke it a bit more and come back. apc is a cache similar to
> eaccelerator, but I've never had issues with it before and I really need it
> - without it, the server rapidly exhausts the RAM available to it.
That would be a bug ... I run wordpress on my site without any of such tricks and it works just fine (and I really don't have any spare RAM there ... the computer is really old clunker).
I don't think so, I think it's just load-dependent (I get somewhat heavy traffic). It's always been the case for me, whether running MDV or Fedora, with pretty different plugin loadouts. When I say 'rapidly' I'm talking 'rapidly in server terms' - say four days or so.
do not use apc or any other accelerators FTM. i'm using php 5.4.5, and both apc and xcache fail in various ways both with wordpress and phpMyAdmin.
this is not a long-term solution, though, but works ATM. however, i'm very curious what will happen with these problems, i can't really imagine running a web server too long without accelerators.
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '17'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 17's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 17 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged change the
'version' to a later Fedora version prior to Fedora 17's end of life.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
I don't remember how exactly, but I fixed this ages ago. It did turn out to just need some kind of cache flush or restart or something.