Fatal error in phpld2.2

Cannot redeclare date_add()

I recently had this problem at my uklearners.com directory:

Fatal error: Cannot redeclare date_add() in www/uklearners.com/include/functions.php on line 1086

It seems the problem occurred since my webhosting upgraded php to php5.3

Here’s what I did to solve the problem:

1. In functions.php found the code

function date_add

and added an A after to make

function date_addA

2. This then left a further problem. I got these messages:

Deprecated: Assigning the return value of new by reference is deprecated in www/uklearners.com/libs/adodb/adodb.inc.php on line 914

Deprecated: Assigning the return value of new by reference is deprecated in www/uklearners.com/libs/adodb/adodb.inc.php on line 1988

Deprecated: Assigning the return value of new by reference is deprecated in www/uklearners.com/libs/adodb/adodb.inc.php on line 2060

So following advice at the phpld forum I accessed these files from my phpld2.2 installation:

/include/functions.php
/admin/init.php
/admin/dir_links_edit.php
/admin/dir_categs_edit.php
/admin/conf_users_edit.php

I then used find and replace to change everywhere that says split to make it say explode

3. I then went here http://sourceforge.net/projects/adodb/files/adodb-php5-only/

and downloaded the latest version of adodb and rep[laced the existing file libs/adodb.inc.php with the new one.

All sorted!


If you’re having difficulty with “Cannot redeclare date_add()” in your version of phpld or cannot locate download for adodb, then hopefully this post will help!

Comments are closed.

Latest Driving School sites

Get Listed

Check if your site is listed at the UK Learners Driving School Directory