# How to fix 'Call to undefined function node_load() in menu.inc' fatal PHP error?

Copied my live site to my local computer. From Windows server 2008 to Windows 7. Took a backup of the database via mysqldump. Restored the database on the dev-db-server. Now I'm trying to get my local copy up-n-running. Browsing index.php gives me

Fatal error: Call to undefined function node_load() in C:\inetpub\wwwroot\my_drupal\includes\menu.inc on line 577


My hunch is that I have missed some web server settings allowing parent path or similar?

I have installed PHP and 5.3.13 and URL Rewriter via Web Platform Installer. According to CHANGELOG.TXT I'm running Drupal 7.0

However phpinfo(); works fine.

Edit / Update: I tried to narrow down the error. Following code fails on line 3. If I change the path on line 2 to something wrong the require_once will fail. Apparently IIS is able to find bootstrap.inc, but bootstrap.inc cannot find user_access()

define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

• I would suggest to rebuild the file registry. Install drush drupal.org/projects/drush and drupal.org/project/registry_rebuild and do a rebuild of the file registry. – junedkazi Oct 6 '12 at 19:20
• @junedkazi - I ran registry_rebuild (without drush) and it seems like that problem is solved. However a new one occurred: Notice: unserialize(): Error at offset 469 of 675 bytes in variable_initialize() (line 749 of C:\inetpub\wwwroot\my_drupal\includes\bootstrap.inc Is this because of the registry_rebuild-script or is my files really corrupt? btw why can't I up your comment? – dbd Oct 6 '12 at 22:11
• Can you just update your drupal version or give the version name. As I am not able to match the line number with my version of drupal 7. I am using Drupal 7.15 and variable_initialize function comes around line 926. Also try to clear all your cache. looking from the function it looks like one of the variable which is fetched via variables table is causing the issue. – junedkazi Oct 7 '12 at 0:38
• @junedkazi I upgraded from 7.0 to 7.15, same error only different offset (469 of 674) . When digging into the system table using where its showing theme related stuff and the value is BLOB. I'm guessing there is an error in file encoding from the mysqldump. Although on the web server the file is UTF-8 (Without BOM) according to Notepad++ but after downloading it to my computer MySQL Workbench complains and wants to convert it. I try to choose UTF-8 but its unable to convert from UTF-8 to UTF-8... Is mysqldump the only option? Rather not install new module on the live site... – dbd Oct 7 '12 at 6:52
• I'm also getting this array_merge(): Argument #2 is not an array in theme_get_setting() (line 1436 of C:\inetpub\wwwroot\my_drupal\includes\theme.inc). Which strengthens my guess about theme and file encoding. If the encoding is messed up, BLOB-data is probably the first datatype to go wrong. – dbd Oct 7 '12 at 6:56

Problem was the file encoding from mysqldump. My solution: Downloaded the sql file to my local computer. Saved it in UTF-8 with Sublime Text 2. Run the script. And things worked fine with the original drupal files copied from web server. Did not need to run registry_rebuild etc.

• I too faced similar issue recently (in drupal7). After saving the mysql dump file as utf-8 and restoring again solved it. Thanks. – Mugunth Aug 17 '16 at 11:30

Here are few tips:

• Make sure your Drupal core has all the files in the right place (especially the Node module)
• Upgrade your Drupal core to the latest version (drush fr && drush up drupal)
• Clear all your caches (drush -y cc all), including your memcached (killall memcached)
• Rebuild your registry by using Registry Rebuild
• If you're using modules which are implementing drupal_bootstrap() (such as Secure Site), disable them
• Try disabling your PHP cache engines (such as XCache, Zend optimizer) to see if that's the problem
• Test it in a different environment/machine
• Check your database collation (it should be case insensitive, e.g.: general_ci).
• Eventually restore your database from the point where it was working before.

I have also encountered the same error. Even if I export using UTF-8 charset the problem was there.

The problem was with HeidiSQL (version 8.3) for me. When I imported it using mysql command everything started working fine.

Had same issue, due to a silly typo mistake in settings.php

As you see in the wrong example below

\$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'd7_mydb',
'host' => 'localhost',
'port' => '',
'driver' => 'mysql',
'prefix' => '',
),
),
);


... once moved the comma in the right place,

'username' => 'dbusername',


my Drupal 7 came back to life

I had this error appear rather suddenly on one of our Drupal 7 sites. Went through a lengthy verification process of other things listed, but in the end, all I did was flush my cache manually as described here.

MySQL:

TRUNCATE TABLE cache;
TRUNCATE TABLE cache_block;
TRUNCATE TABLE cache_bootstrap;
TRUNCATE TABLE cache_field;
TRUNCATE TABLE cache_filter;
TRUNCATE TABLE cache_image;
TRUNCATE TABLE cache_page;
TRUNCATE TABLE cache_path;
TRUNCATE TABLE cache_token;
TRUNCATE TABLE cache_update;


SQL Server:

DELETE FROM cache;
DELETE FROM cache_block;
DELETE FROM cache_bootstrap;
DELETE FROM cache_field;
DELETE FROM cache_filter;
DELETE FROM cache_image;