Fatal error: Cannot redeclare timer_start() (previously declared in M:\websites\mysite\includes\bootstrap.inc:116) in M:\website

Drupal: 5.2 installed in the vhost root
php: 5.23
Centos + Apache

This error started popping up after upgrading to php 5.23. It happens intermittently. I noticed it occurs especially after a reboot of the VPS account. The last time it occured was when I was replying to a forum topic.

Possibly related: http://drupal.org/node/152612

Comments

Mojah’s picture

Version: 5.2 » 5.7

This error seems to appear on a few sites. Many appear to be Drupal and Wordpress installs.

Here is a google search that shows sites which displayed this error when the googlebot was visiting...
http://www.google.com/search?sourceid=mozclient&num=30&ie=utf-8&oe=utf-8...

Here is a handbook page from redmonk who experienced this error when trying to integrate something between Wordpress and Drupal.
http://drupal.org/node/74350

He mentions that Drupal and Wordpress were defining the same functions.

Its a difficult to replicate error as it may happen on any node at any time.

I'm wondering if its related to a module or perhaps another application that calls the timer_start() function.

ponkarthik’s picture

Version: 5.7 » 6.2

Hi,

I am getting the following error randomly

Fatal error: Cannot redeclare timer_start() (previously declared in /home/smsn/public_html/wp-settings.php:115) in /home/xssww/public_html/includes/bootstrap.inc on line 142

My installation is Drupal 6.2 with PHP 4.4.4 in shared hosting

I gather form the above post and another post

http://drupal.org/node/152612

that this is due to a unrelated wordpress install in shared hosting. A lot of other websites also seem to be getting this error as indicataed from google search.

Please let me know if there is any solution for this ?

Karthik

cog.rusty’s picture

If I understand this correctly, apparently wp-settings.php is a wordpress file which tries to bootstrap Drupal, which fails because both Drupal and WP have a function named timer_start().

If it is so, there is nothing wrong with Drupal, WP, or the server. It is just that this method is broken.

cog.rusty’s picture

Oops. In poncarthic's case the function re-definition happens on different sites, so the problem is more complicated than I though. Maybe someone who understands XML-RPC can explain it.

adminfor@inforo.com.ar’s picture

This could be useful http://drupal.org/node/72099
My problem was about a duplicate function declaration but embedded in a node with PHP code. So, this is no enough to search in code. You could try finding for PHP in nodes and blocks.
Just to illustrate, I had a PHP form declaration duplicated in some nodes and the problem appear when both get catched in a search result. So, was enough to add a "2", "3" to avoid duplication.
----

SELECT * FROM node_revisions
WHERE body LIKE '%functionname%'

----

SELECT * FROM boxes
WHERE body LIKE '%functionname%'

-----
enjoy!
Gustavo

mdupont’s picture

Status: Active » Closed (works as designed)

For one reason or another a file from Wordpress containing a function named timer_start() is included in the same request than Drupal, which also have a function named timer_start(). This is not a bug, only an incompatibility, and this Wordpress file shouldn't be included along Drupal... There is not much that can be done here, apart from Drupal or Wordpress suddendly deciding to rename timer_start() to something else.