News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

ERROR: Call to undefined function: array_combine()

Started by deathwielder, January 21, 2009, 04:41:49 PM

Previous topic - Next topic

deathwielder

Hello Everyone;

In an effort to get prepared for the ultimate release of SMF 2.0 RC1 - I decided to plunge into updating my existing forums from SMF 1.1.17.

1. I re-created the MySQL database naming the new database "forums-2B4"

2. I created a NEW SMF directory called " /apache/vhosts/<domain-name>/forums-2B4" next to the existing SMF called "/apache/vhosts/<domain-name>/forums". 

3. I moved the existing files into "/apache/vhosts/<domain-name>/forums-2B4" from "/apache/vhosts/<domain-name>/forums" keeping the exisitng permissions.

4. I then ran "repair_settings.php" which allowed the settings to be properly repaired. 

5. I then removed any and all mods that had been applied.  (although further attempts proved that this was unnecessary)

6. I uploaded the files from SMF 2.04 Beta Large upgrade overwriting any existing files as needed.

7. I began the "upgrade" process using the upgrade.php.

8. These steps go through fine -
      Step 1: Login
      Step 2: Upgrade Options
      Step 3: Backup

HOWEVER when the process begins "Step 4: Database Changes"  it APPEARS to go fine.  The Overall Progress: bar goes to 79% while the Step Progress: goes to 100%.  The routine reports that the database has been updated and the continue button is available.  This is where the problem arises with this error message

Fatal error: Call to undefined function: array_combine() in /apache/vhosts/<domain-name>/forums-2B4/Sources/Subs-Db-mysql.php on line 629

In an effort to help myself I then tried a FULL install and it ran all the way through with no errors.

I repeated the above steps after new download thinking maybe I had an error during the original download no joy.

CURRENT OPERATING environment

Linux
MySQL vsn 4.0.20
PHP vsn 4.3.8

1036096k Memory
dual processor

Any suggestions or recommendations would be appreciated.

BJ


JimM

Welcome to SMF

I googled that error and according to what I found it could be your version of PHP.  The array_combine() command seems to be specific to PHP 5.0.
Jim "JimM" Moore
Former Support Specialist

deathwielder

Does that mean that PHP 5 is REQUIRED for the upgrade then???




JimM

Actually it shouldn't be.  A search came back with this:

Quote
Can you double check your Subs-Compat.php file to make sure it is up-to-date.  There is an array_combine implementation in that file and the file should be included by the upgrader.

Jim "JimM" Moore
Former Support Specialist

deathwielder

From the file header


<?php
/**********************************************************************************
* Subs-Compat.php                                                                 *
***********************************************************************************
* SMF: Simple Machines Forum                                                      *
* Open-Source Project Inspired by Zef Hemel ([email protected])                    *
* =============================================================================== *
* Software Version:           SMF 2.0 Beta 4                                      *
* Software by:                Simple Machines (http://www.simplemachines.org)     *
* Copyright 2006-2008 by:     Simple Machines LLC (http://www.simplemachines.org) *
*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             *
* Support, News, Updates at:  http://www.simplemachines.org                       *
***********************************************************************************


starting on line 193 is this code


if (!function_exists('array_combine'))
{
function array_combine($keys, $values)
{
$ret = array();
if (($array_error = !is_array($keys) || !is_array($values)) || empty($values) || ($count=count($keys)) != count($values))
{
trigger_error('array_combine(): Both parameters should be non-empty arrays with an equal number of elements', E_USER_WARNING);

if ($array_error)
return;
return false;
}

// Ensure that both arrays aren't associative arrays.
$keys = array_values($keys);
$values = array_values($values);

for($i=0; $i < $count; $i++)
$ret[$keys[$i]] = $values[$i];

return $ret;
}
}



There is no other reference to the array_combine() function within that file.

BJ

JimM

Here is an topic about an upgraded tool.  Download the upgrade.php file and try it.

http://www.simplemachines.org/community/index.php?topic=217854.msg1390290#msg1390290

ETA:  Sorry, I'm still looking!
Jim "JimM" Moore
Former Support Specialist

deathwielder

Ooops that URL gives

An Error Has Occurred!
The topic or board you are looking for appears to be either missing or off limits to you. 

BJ

JimM

That link is in the Charter Member area and the file is old, sorry about that.  I'm still looking!
Jim "JimM" Moore
Former Support Specialist

Advertisement: