Reply to Re: Upgarding php4 to php5 leads to: PHP Fatal error: Call to undefined function ...

Your name:

Reply:


Posted by Erwin Moller on 03/07/07 08:53

java@wispa.de wrote:

> Hey there,
>
> I just removed an elderly PHP4-Installation from my Windows-Box and
> installed PHP 5.2.1. I used the PHP4-Module as local batchfile-
> interpreter by
>
> E:\ersDHCP>php ./extractLog.php
>
> which was perfectly alright and worked well. But now PHP5 fails to run
> the same script without any modification!
>
> E:\ersDHCP>php ./extractLog.php
> ... a bunch of php-code ...
> PHP Fatal error: Call to undefined function getConnectionDetails() in
> E:\ersDHCP\extractLog.php on line 21
>
> PHP5 pretends failure to include a self-defined function
> getConnectionDetails() that is stored in a file named
> getConnectionDetails.php in the current directory just next to
> extractLog.php. Using this script never has been a problem with PHP4
> and I have no idea how to cope with this. Can anybody help me?
>
> Thanks in advance
>
> Christian
>
> extractLog.php
> =============
>
> <?php
>
> include_once('writeTextFileHeader.php');
> include_once('dumpDhcpLogToTextFile.php');
>
> include_once('writeMySqlCreateScript.php');
> include_once('dumpDhcpLogToMySqlInsertScript.php');
>
> include_once('dumpDhcpLogToMySqlServer.php');
>
> include_once('traverseDirTree.php');
> include_once('getArgValue.php');
>
> include_once('getConnectionDetails.php');
>
> set_time_limit(0);
> error_reporting(E_ALL);
>
> $version = "Version 3.1 vom 7.3.2007";
>
> $parameter = &getConnectionDetails(false);
>
> getConnectionDetails.php
> ====================
> <?
>
> include_once('getDefaultHead.php');
> include_once('getDefaultFoot.php');
>
> include_once('getConnectionDetailsFromIniFile.php');
>
> function &getConnectionDetails($dieOnFailure)
> {

Hi,

Hard to say.
I would start by replacing all include_once() by require_once() so you get
errors if something is wrong with finding the file (like permission,
another path than you expect, etc)

It is in general a good habbit to use require() instead of include because
the include will only fire a notice if the file is not found, and notices
can easily be disabled in php.ini (and often are).

If require() fails, you know where to start.

Regards,
Erwin Moller

Regards,
Erwin Moller

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация