PHP Fatal error: Cannot redeclare token_token_info_alter() (previously declared in token/token.tokens.inc:11) in token/token.tokens.inc on line 89

install 7.x-1.3
run update.php
no token updates resulting
I get a wsod.
I look in the logs and see the above error, which I don't quite understand.

Comments

dave reid’s picture

Status: Active » Postponed (maintainer needs more info)

I would say re-download the files because your token.tokens.inc file is corrupt. There is clearly not another definition of token_token_info_alter() on line 83: http://drupalcode.org/project/token.git/blob/963569d1f28b2627ba7511b4cad...

socialnicheguru’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

that was weird. you were right.

yareckon’s picture

Another culprit for this is APC or other opcode cache that contains both the old and new function declarations. In my case this exact error was caused by APC. When I put a bunch of whitespace in the top of the affected file only one of the conflicting declarations changed line number which means that the other one was a phantom in some sort of cache. Restarting apache clears the APC cache. It's funny that the token module gets hit with this one. I think I have another site where it happened too... maybe something about that byte sequence triggers an APC bug.

sabarigr’s picture

I had the same problem while I was about to install the OpenDeals module. There was two token project references one in my drupal theme folder & another came with the OpenDeals project preattached. I removed the one within the OpenDeals module and got rid of this error. Hope this helps.

Thank you for reading..

Have a good day.!

rohnjeynolds’s picture

This is an old thread but we just had the same error and traced it back to APC. Turning off APC resolved the issue, but that wasn't an option for us. We got relief by allocating more memory to APC in the environments where we were getting this error. In apc.ini (on Ubuntu), we changed this:
apc.shm_size=256M
to
apc.shm_size=512M
And restarted the Web server.
There are posts on the Web reporting similar errors and suggesting that a bug in APC is the real culprit, but if you're not in a position to disable or replace APC, upping the memory allocation might be worth trying first.

Morten Najbjerg’s picture

Issue summary: View changes

I can confirm what rohnjeynolds says in #5. Thanks! APC seems to be the one causing the headache.
I experienced this in my local development environment using MAMP.