php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17747 PHP Fatal error: Cannot redeclare function_name()
Submitted: 2002-06-13 12:59 UTC Modified: 2002-06-15 11:00 UTC
From: lukemiller at mac dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.1.2 OS: RH 7.2
Private report: No CVE-ID: None
 [2002-06-13 12:59 UTC] lukemiller at mac dot com
This is similar to <a href="http://bugs.php.net/bug.php?id=
17720">this bug report</a>, but I'm using PHP 4.12. 

I have an include file called "func-inc.php" with a 
function declared like so...

function dbq($str) {
  print($str);
}

...and a main_file.php like so ...

require_once("func-inc.php");

dbq("print this");

I have error reporting off on my server, so I don't get a 
message when running main_file.php, but intermittently (I'd 
say 10% of the time it does NOT work) the script will just 
hang and never return anything. When I check the Apache 
error_log file it shows the error "PHP Fatal error:  Cannot 
redeclare dbq()" even though it's only been declared once 
in the include file.

The next line always seems to be some variation of:
"[notice] child pid 996 exit signal Segmentation fault 
(11)"

My PHP config line is:
'./configure' '--with-mysql' '--with-gd' '--with-jpeg-dir' 
'--with-apache=../apache_1.3.24'



I've never had this problem running on Mac OS X (PHP 4.12) 
with the config line:
?'/SourceCache/apache_mod_php/apache_mod_php-7/php/
configure' '--prefix=/usr' '--mandir=/usr/share/man' '--
infodir=/usr/share/info' '--with-apxs'

Hope there's an answer for this.

Luke

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-13 15:07 UTC] sniper@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

Please try this with PHP 4.2.1.
 [2002-06-14 00:33 UTC] lukemiller at mac dot com
Here's what I've done. Installed php 4.1.2 with debug 
option enabled but I must have done something wrong because 
I got a message that no debug symbols were found when I 
entered the command #gdb /path/to/apache/bin/httpd. 

However, I figured out that when the pdflib module was NOT 
loaded (I have it loaded through extenstion=/path/to/
libpdf_php.so) that I wasn't getting the error. I disable 
debugging and it still worked fine (no errors) as long as 
pdflib was disabled.

If this is a pdflib problem, sorry for the trouble. 
However, a couple of things, with my limited knowledge of 
PHPs engine, make me think that it might be a problem with 
PHP. 1) The error is related to defining php functions and 
2) I get the error in scripts that aren't calling and 
pdflib functions. 

I have tried, briefly, reproducing the problem with 4.2.1 
but I ran into a problem with my pdlib modules compile 
version. I will try that some more and let you know what I 
find.

Thanks for your time.
 [2002-06-15 11:00 UTC] lukemiller at mac dot com
OK. I think I've fixed the problem. It seems like it was 
problem with pdflib. For those of you who are having a 
similar problem, one of the scripts that called pdflib was 
causing a fatal error which eventually caused a 
segmentation fault and other PHP script errors which caused 
all kinds of problems with the rest of the sites/scripts 
and eventually crashed the server. 

The script is fixed and everything is working fine.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 07:00:01 2026 UTC