Gossamer Forum
Home : Products : Gossamer Links : PHP Front End :

Fatal problem with PHP 4.3.1 (?)

Quote Reply
Fatal problem with PHP 4.3.1 (?)
My server was just upgraded to PHP 4.3.1 last night, and I was surprised to see this morning that all Links pages would not load and produced the following:

[13-Apr-2003 03:12:55] PHP Fatal error: Cannot redeclare unixdate() in /path/to/admin/Links/PHP/adodb/adodb.inc.php on line 1219

Don't yet know the cause of the new problem without looking into it further, but the two things that jumped out at me are that the function in adodb.inc.php has different case -- UnixDate() -- and that it shows up three times within the file (presumably declared conditionaly each time?).

If anyone has any insight into this problem, that would be appreciated... It would be nice to have my site working. Crazy

Dan
Quote Reply
Re: [Dan Kaplan] Fatal problem with PHP 4.3.1 (?) In reply to
Apparently this is a fairly major bug. See:

http://www.aota.net/...stid=85714#post85714

I'll have to go through the script and see if I can find a temporary solution...

Dan
Quote Reply
Re: [Dan Kaplan] Fatal problem with PHP 4.3.1 (?) In reply to
If it helps any, here are the files I found that contain UnixDate() references:

Links/PHP/adodb/adodb.inc.php - 253, 255, 1190, 1219, 1625, 1641

Links/PHP/adodb/readme.htm - numerous references; line numbers probably not important

Links/PHP/adodb/tips_portable_sql.htm - 182

Each of the alternative database adodb-???.inc.php files contain instances the same as adodb.inc.php

Links/PHP/adodb/tests/test.php - several instances.

Those are the only instances I could find, so it would appear to be largely a matter of making either a single UnixDate() function that is flexible enough to do what each call to it requires or to make separate functions that are named differently and perform what ever is required of them. Quite honestly, I'm very surprised and disappointed this was not done in the first place...

Dan
Quote Reply
Re: [Dan Kaplan] Fatal problem with PHP 4.3.1 (?) In reply to
Hi Dan,

I'm not sure what's the cause for that error (PHP or ADOdb), but a new version of ADOdb will fix the problem. I've attached a slightly modified version of ADOdb v3.30 that works with LinksSQL. The reason it's been modified is that ADOdb either lower()'s or upper()'s the column names in the results, and I've disabled that (the change is in adodb-recordset.inc.php). I've got this running on my machine here, so it should also work for you.

I forgot to mention, that you can just uncompress the attachment right into admin/Links/PHP (it uncompresses into the adodb directory), but you should move your current adodb to adodb.old before you do this.

Adrian

Last edited by:

brewt: Apr 13, 2003, 3:07 PM
Quote Reply
Re: [brewt] Fatal problem with PHP 4.3.1 (?) In reply to
Thanks Adrian, that seems to have worked. I didn't realize those /adodb/ files were not authored by GT, although looking back, I see that is obvious from the header comments.

Quote:
I'm not sure what's the cause for that error (PHP or ADOdb)
Best I can tell, it was just a very poor programming choice on the part of ADOdb. It never would have occurred to me that the conditionally re-declared function convention would work in the first place, and it's not at all surprising that the ability was removed.

Dan
Quote Reply
Re: [brewt] Fatal problem with PHP 4.3.1 (?) In reply to
Hello, I'm having the same problem. I tried installing a newer version of ADOdb, but that just creates new problems. Could I get a copy of the undated ADOdb scripts which work with this install?

Thanks in advance.
Quote Reply
Re: [jimfurtado] Fatal problem with PHP 4.3.1 (?) In reply to
Just use the ones that are attached to my post above.

Adrian
Quote Reply
Re: [brewt] Fatal problem with PHP 4.3.1 (?) In reply to
Sorry about that. I completely overlooked the attachment link. Thanks for pointing it out to me.
Quote Reply
Re: [brewt] Fatal problem with PHP 4.3.1 (?) In reply to
Warning: extract(): First argument should be an array in /path/to/links/admin/Links/PHP/Links.inc.php on line 200

Warning: extract(): First argument should be an array in /path/to/links/admin/Links/PHP/Links.inc.php on line 200

Warning: extract(): First argument should be an array in /path/to/links/admin/Links/PHP/Links.inc.php on line 200

Warning: extract(): First argument should be an array in /path/to/links/admin/Links/PHP/Links.inc.php on line 200

Warning: extract(): First argument should be an array in /path/to/links/admin/Links/PHP/Links.inc.php on line 200



That error is this? it appears later that I brought up to date the available ADODB in this forum.
Quote Reply
Re: [Janio] Fatal problem with PHP 4.3.1 (?) In reply to
erm, that's strange. Try changing that line from:
Code:
if (isset($TPL_GLOBALS[$template_set])) {
extract($TPL_GLOBALS[$template_set]);
}
to:
Code:
if (isset($TPL_GLOBALS[$template_set]) and is_array($TPL_GLOBALS[$template_set])) {
extract($TPL_GLOBALS[$template_set]);
}

Adrian
Quote Reply
Re: [brewt] Fatal problem with PHP 4.3.1 (?) In reply to
Ok.. Which line is this code? in which archive?
Quote Reply
Re: [Janio] Fatal problem with PHP 4.3.1 (?) In reply to
To decide the problem I annulled line 200 thus:

// extract($TPL_GLOBALS[$template_set ]);



but as to decide this problem?



brewt says which to me script to modify and where line?

Last edited by:

Janio: Jan 22, 2004, 6:36 PM
Quote Reply
Re: [brewt] Fatal problem with PHP 4.3.1 (?) In reply to
THX, just saved my head with this post!

Regards

n || i k o