Community Documentation

Fatal error: Cannot redeclare blah_function() in ../modules/blah.module

Last updated November 12, 2009. Created by kanani on July 4, 2006.
Edited by forestmonster, kenorb, Francewhoa, LeeHunter. Log in to edit this page.

When using Drupal your browser returns the following error

Fatal error: Cannot redeclare blah_function() (previously declared in /modules/blah.module:blah) in ...blah... on line blah

Often occurs on:

  • admin/modules
  • admin/themes
  • after modifying module or theme files
  • after duplicating module folder
  • after upgrading the module and forgot to remove old files

To fix this, select one of the possible causes listed below.

Comments

This can also be triggered by

This can also be triggered by opcode cachers like APC and a restart of your httpd and or php-fpm is require to remedy it.

Got Fatal error: Cannot

Got Fatal error: Cannot redeclare phptemplate_init() in /themes/engines/phptemplate/phptemplate.engine... after installing eAccelerator. Managed to solve the issue by setting eaccelerator.filter = "*.engine" in php.ini and restarting apache. This setting exludes *.engine files from caching.

Thanks, that appeared to be

Thanks, that appeared to be it for me

-------------------------------
also known as peach
Still running SooperThemes Premium Drupal Themes

Another cause in my case

I got this error after upgrading from php 5.2 to php 5.3. However I forgot to also upgrade xdebug library. In fact I thought I removed it from my php.ini but it wasn't. I realized this was the issue when looking at /var/log/apache2/error.log.
Anyway, that error disappeared when I upgraded xdebug.

drush is case sensitive when it comes to paths (!)

Beware - if you navigate to the project folder ignoring case then drush will throw a wobbly.

Reference: https://network.acquia.com/node/1473655

Hope this will save you banging your head against a brick wall for several hours like I did.

Kester Hynds
www.komoko.co.uk

Page status

No known problems

Log in to edit this page

About this page

Drupal version
Drupal 4.5.x or older, Drupal 4.6.x, Drupal 4.7.x, Drupal 5.x, Drupal 6.x, Drupal 7.x
Audience
Developers and coders, Site administrators

Reference

Drupal’s online documentation is © 2000-2012 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.
nobody click here