473,508 Members | 2,229 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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)
{

Mar 7 '07 #1
9 5242
ja**@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
Mar 7 '07 #2
Hey Erwin,

I replaced any include_once with require_once but did not notice any
change in PHP's behaviour - it still starts, dumps all the source and
terminates PHP Fatal error: Call to undefined function :-(

I even changed php.ini and set error_reporting = E_NOTICE but still
there is no more information about the failure. The syntax of all php-
files is ok and checked with php -l and I am totally stuck with this.
Any further ideas how to locate the source of this very short error-
message?

Regards,

Christian

Mar 7 '07 #3
Rik
<ja**@wispa.dewrote:
Hey Erwin,

I replaced any include_once with require_once but did not notice any
change in PHP's behaviour - it still starts, dumps all the source and
terminates PHP Fatal error: Call to undefined function :-(

I even changed php.ini and set error_reporting = E_NOTICE but still
there is no more information about the failure. The syntax of all php-
files is ok and checked with php -l and I am totally stuck with this.
Any further ideas how to locate the source of this very short error-
message?

Yes, indeed. It dumps the source you say, and gives a php error message
about not being defined? This leds me to believe there is a reason your
file is not interpreted as PHP, while others are.

Then this snippet:
getConnectionDetails.php
====================
<?

Lets me say:
short_open_tag
<http://nl3.php.net/manual/en/ini.core.php>

You're advised to use <?php instead of <?, untill you've changed all your
files, set short_open_tag to on.
--
Rik Wasmus
Posted on Usenet, not any forum you might see this in.
Ask Smart Questions: http://tinyurl.com/anel
Mar 7 '07 #4
On Wed, 07 Mar 2007 18:03:51 +0100, Rik wrote:
<ja**@wispa.dewrote:
>Hey Erwin,

I replaced any include_once with require_once but did not notice any
change in PHP's behaviour - it still starts, dumps all the source and
terminates PHP Fatal error: Call to undefined function :-(

I even changed php.ini and set error_reporting = E_NOTICE
I think you should set it to E_ALL or even E_STRICT (which fires php5
"compatibility" notices)

bye
--
NoWhereMan (e.v.)
-- http://www.nowhereland.it
-- http://flatpress.nowhereland.it
Mar 7 '07 #5
Rik
NoWhereMan <no**************@flashmailSPAM.comwrote:
On Wed, 07 Mar 2007 18:03:51 +0100, Rik wrote:
><ja**@wispa.dewrote:
>>Hey Erwin,

I replaced any include_once with require_once but did not notice any
change in PHP's behaviour - it still starts, dumps all the source and
terminates PHP Fatal error: Call to undefined function :-(

I even changed php.ini and set error_reporting = E_NOTICE

I think you should set it to E_ALL or even E_STRICT (which fires php5
"compatibility" notices)
A total block of php not run/a function not being declared is hardly a
'compatibility'/notice problem... Allthough I agree using notices in
development/checking after updating is a real timesaver.

--
Rik Wasmus
Posted on Usenet, not any forum you might see this in.
Ask Smart Questions: http://tinyurl.com/anel
Mar 7 '07 #6
On Wed, 07 Mar 2007 19:22:42 +0100, Rik wrote:
NoWhereMan <no**************@flashmailSPAM.comwrote:
>On Wed, 07 Mar 2007 18:03:51 +0100, Rik wrote:
>><ja**@wispa.dewrote:

Hey Erwin,

I replaced any include_once with require_once but did not notice any
change in PHP's behaviour - it still starts, dumps all the source and
terminates PHP Fatal error: Call to undefined function :-(

I even changed php.ini and set error_reporting = E_NOTICE

I think you should set it to E_ALL or even E_STRICT (which fires php5
"compatibility" notices)

A total block of php not run/a function not being declared is hardly a
'compatibility'/notice problem...
sure, so E_ALL should be fine
--
NoWhereMan (e.v.)
-- http://www.nowhereland.it
-- http://flatpress.nowhereland.it
Mar 7 '07 #7
ja**@wispa.de wrote:
Hey Erwin,

I replaced any include_once with require_once but did not notice any
change in PHP's behaviour - it still starts, dumps all the source and
terminates PHP Fatal error: Call to undefined function :-(

I even changed php.ini and set error_reporting = E_NOTICE but still
there is no more information about the failure. The syntax of all php-
files is ok and checked with php -l and I am totally stuck with this.
Any further ideas how to locate the source of this very short error-
message?

Regards,

Christian
Hi Christian,

I had a similar problem a week ago, and I now see how it could be relevant
to your problem too. Maybe they are the same.

An app I made works great. Of course. ;-)
Then somebody wanted to install it on his own laptop, for testingpurposes,
and as it turned out he couldn't get it running.
My app failed on a call to an undefined function.
Since I was sure that function existed, I checked with him the include_path
and stuff like that. All seemed OK.

The most starnge thing was this:
- I asked him to put an
echo "TESTING!";
at the end of the includefile, and THAT did appear on the screen.
But NONE of the functions inside the includefile were found.

I was awestuck, so I jumped into my car and visited him, because actually I
couldn't believe this was happening, and I expected he made some stupid
mistake.
After some edditing in the file, all of a sudden all functions were found,
and things kept working.
Because we had no clue WHAT we changed that could be remotely important, we
placed back the old, original file, but still the problem didn't return.
This was on XP with PHP5.
Very frustrating.

At first I thought the guy didn't get the files in right, with ftp, and
screwed up some end-of-lines somewhere, but placing back the original file
didn't give the problem again.
So I am shooting in the dark with my end-of-line hypothesis.

I am unsure if my story is relevant to your situation, but you might try to
do the same: edit the file e little, safe it, and see if it works.
I know how stupid it sounds, but give it a shot.

Regards,
Erwin Moller
Mar 8 '07 #8
java wrote:
dumps all the source
Rik hit the nail on the head: short_open_tags.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Mar 8 '07 #9
java wrote:
dumps all the source

Rik hit the nail on the head: short_open_tags.
Excuse me posting this late: short_open_tags did the trick, thanks
alot!

Mar 8 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
13649
by: Mike | last post by:
Last weekend I decided to install Apache 2.0.53-win32-x86-no_ssl PHP 5.0.3 Smarty 2.6.7 MySQL essential-4.1.10-win32 I have Apache up (Port 80 blocked at the router and firewall!) and I have...
4
5419
by: Kevin | last post by:
Hi all, I've got a PHP4 app that I developed which I'm trying to get to run on a PHP5 server. Everything works great, except for one thing. There's a particular routine that creates an...
4
1788
by: Andy Baxter | last post by:
hello, I'm using the php4-mysql module with php4 under debian linux (sarge). I have a script, schedule.php, which runs fine when I invoke it from the command line, but fails with the error: ...
8
4188
by: Cruella DeVille | last post by:
I'm writing a class to handle reading/writing from/to files like this (shortened) lass FileIO{ private $filename; private $mode; private $filePointer; private $dictionary; public function...
1
7130
by: Swincher | last post by:
Hey - - -- I upgraded my development machine to PHP5. My pages with the subject function no longer work. I am able to do an ODBC connect to the data files from other programs. I get the...
7
1717
by: Mathieu Maes | last post by:
Hi there I'm quite experienced in programming in PHP4, but I would like to make a step to PHP5. I created following class which works perfectly in PHP4 : Class Nessi { // ident part
3
3282
by: xhe | last post by:
I have just upgraded my php version form php4 to php5. and I met this problem, and don't know if you know the solution. My site was written in PHP4, and most parts can be running smoothly in PHP5,...
1
2279
by: inetquestion | last post by:
I am getting this error: "Fatal error: Call to undefined function socket()" even after reinstalling php4 and php5 with the following configuration: ./configure --with-gd=/usr/local --with-mysql...
3
3460
by: jmark | last post by:
I am currently running php 4.4.7 in windows xp and apache 2. If I enter php in command line. I get the following error The application has failed to start because php5ts.dll was not found" I...
0
7229
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7333
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7398
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7061
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5637
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4716
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3208
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3194
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1566
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.