Closed (fixed)
Project:
Drupal core
Version:
4.6.3
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Mar 2005 at 19:21 UTC
Updated:
2 Sep 2006 at 16:45 UTC
Sporadically, I get the error:
Fatal error: Cannot redeclare conf_init() (previously declared in /usr/local/share/drupal-4.5.2/includes/bootstrap.inc:20) in /usr/local/share/drupal-4.5.2/includes/bootstrap.inc on line 19
Lines 19 and 20 contain:
19: function conf_init() {
20: $uri = $_SERVER['PHP_SELF'];
Reloading the page causes the page to come back normally, but I've been seeing this once every few days, and at least one of my pages got indexed by google with this error.
The system is running Debian GNU/Linux, with Drupal installed by hand locally rather than using the Debian package for it. The version of PHP is 4.3.10-8.
Comments
Comment #1
moshe weitzman commentedthose 2 lines do different things. there is no 'redeclare' happenning. this is a local issue, until someone chimes in and verifies.
Comment #2
bigmouth commentedEvery 5-15 page loads or so I get the error described by the parent. I made some changes to the modules I'm using, so I disabled *all* of them, and it still happens.
I get a bunch of notices about the various constants being redefined (CACHE_PERMANENT through WATCHDOG_ERROR). After that, parsing stops at conf_init:
Fatal error: Cannot redeclare conf_init() (previously declared in /usr/local/www/*snip*/drupal/includes/bootstrap.inc:45) in /usr/local/www/*snip*/drupal/includes/bootstrap.inc on line 44
Where *snip* is definitely the same string for both lines.
Note that, just like the parent, PHP is complaining about conf_init being declared twice in two consecutive lines. If you look at the file, however, the function starts normally:
44: function conf_init() {
45: static $conf = '';
I have checked my installation by grepping for bootstrap.inc, and it is always 'include_once'ed (i.e. there should not be any problems with it being included twice). If you think about it, it is quite bizarre.
I also did some unscientific experiments by putting in prints in some modules (like taxonomy), and the error happens before any of those statements are reached. When I refresh, the error will be gone and everything functions normally for a few page loads.
I'm running PHP 4.4.1 on FreeBSD.
Comment #3
pukku commentedI have the exact same error. I just upgraded to PHP 4.4.1 on FreeBSD (5-STABLE) from PHP 4.4.0, and this error suddenly started appearing. It seems to be related to the clean urls setting, as the problem has not occurred in the five minutes since I turned that setting off, but occurred constantly before then. The PHP 4.4.1 change notes don't seem to have any mention of something that could cause this.
Comment #4
mfbYep, suddenly getting this error on freebsd w/ php 4.4.1. Manually changing the clean_urls setting via the database seemed to "fix" a 4.5 site but did not help a 4.6 site. The other symptom is some pages loading up completely blank. Either local or a php 4.4.1 problem; I will try rebuilding all ports on the system.
Comment #5
bart jansens commentedI had the same problem after upgrading php to version 4.4.1.
- pages that use clean urls no longer work, you get a blank page and some errors about not being able to include some files in the error log.
- without clean urls, things seem to work most of the time.
The cause is most likely this: http://bugs.php.net/bug.php?id=35059
So if you feel like upgrading to php 4.4.1, take a break and wait for the feeling to go away.
If you are stuck with php 4.4.1 because you don't own the server, here's what I did:
* Disabled clean urls
* Changed .htaccess so that people who still try to use the clean urls are being redirected instead of using an internal rewrite:
Comment #6
mfbI was able to fix my 4.6 site by turning off clean urls and also emptying the cache table.
Comment #7
magico commentedComment #8
(not verified) commented