Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot redeclare getDB() #684

Closed
lifepillar opened this issue Mar 24, 2017 · 6 comments
Closed

Cannot redeclare getDB() #684

lifepillar opened this issue Mar 24, 2017 · 6 comments

Comments

@lifepillar
Copy link

I am using the current master. On trying to import a data set with this command:

cd build
./utils/setup.php --osm-file map.osm --all 2>&1 | tee setup.log

I get this error:

Fatal error: Cannot redeclare getDB() (previously declared in /Web/php/nominatim/lib/db.php:6) in /Web/php/nominatim/lib/DB.php on line 19

Any idea what the problem is and how I can fix it?

@mtmail
Copy link
Collaborator

mtmail commented Mar 24, 2017

The message is a bit misleading as PHP needs to load the file DB.php and instead re-loads Nominatim's db.php. To solve this make sure you have the Pear module 'DB' installed.

 sudo pear install DB

@lifepillar
Copy link
Author

The fact is, I do have it installed:

<?php
require_once('DB.php');
var_dump(class_exists('DB', false));
?>
$ php test-db.php
bool(true)

@mtmail
Copy link
Collaborator

mtmail commented Mar 24, 2017

Any chance the test-db script loads the wrong DB class? For example if that class has a getDBQuoted method then it would be nominatim/lib/db.php

@lonvia
Copy link
Member

lonvia commented Mar 24, 2017

How about just renaming Nominiatim's db.php file? It is only referenced once in init.php as far as I can see, so that should be quick.

@lifepillar
Copy link
Author

Same error. Anyway, I have created a VirtualBox image with a fresh Ubuntu system, I was able to install Nominatim there following the instructions in the Readme, and now it's loading my data. For my purposes that should be enough.

@lonvia
Copy link
Member

lonvia commented Mar 26, 2017

We really should switch to mdb2.

Closing for now as it is not reproducible here. Please reopen if you can supply more information.

@lonvia lonvia closed this as completed Mar 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants