Bug 826623

Summary: PHP 5.4.3 breaks Wordpress: "Cannot redeclare create_initial_post_types()"
Product: [Fedora] Fedora Reporter: Adam Williamson <awilliam>
Component: phpAssignee: Joe Orton <jorton>
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 17CC: fedora, jorton, mcepl, mcepl, pdx, rpm
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-03 23:15:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
The offending PHP file none

Description Adam Williamson 2012-05-30 15:52:11 UTC
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.

Comment 1 Adam Williamson 2012-05-30 15:52:51 UTC
Created attachment 587770 [details]
The offending PHP file

Comment 2 Joe Orton 2012-06-06 16:21:34 UTC
What version of wodrespss are you using?

I just did a wordpress install & could create a page using:

php-5.4.3-1.fc17.x86_64
wordpress-3.3.2-2.fc17.noarch

Have you got any changes to the default php.ini, wordpress config, or similar?

Comment 3 Joe Orton 2012-06-06 16:22:35 UTC
(Apologies for my inability to type "wordpress" there)

Comment 4 Matěj Cepl 2012-06-06 18:01:50 UTC
(In reply to comment #2)
> Have you got any changes to the default php.ini, wordpress config, or
> similar?

Specifically, what

rpm -V php wordpress

says? (and attach php.ini and wordpress/config.php as well, please)

Comment 5 Adam Williamson 2012-06-12 18:02:13 UTC
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.

Comment 6 Adam Williamson 2012-06-12 18:03:53 UTC
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.

Comment 7 Remi Collet 2012-06-12 18:05:58 UTC
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.

Comment 8 Matěj Cepl 2012-06-12 18:49:12 UTC
(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.

Comment 9 Adam Williamson 2012-06-13 00:11:35 UTC
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.

Comment 10 Matěj Cepl 2012-06-13 06:23:35 UTC
(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).

Comment 11 Adam Williamson 2012-06-13 17:28:55 UTC
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.

Comment 12 Andras Kemeny 2012-08-18 10:14:24 UTC
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.

Comment 13 Fedora End Of Life 2013-07-03 23:05:16 UTC
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.

Comment 14 Adam Williamson 2013-07-03 23:15:55 UTC
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.