1 # Running Your Own Instance
3 ### Can I import only a few countries and also keep them up to date?
5 You should use the extracts and updates from https://download.geofabrik.de.
6 For the initial import, download the countries you need and merge them.
7 See [OSM Help](https://help.openstreetmap.org/questions/48843/merging-two-or-more-geographical-areas-to-import-two-or-more-osm-files-in-nominatim)
8 for examples how to do that. Use the resulting single osm file when
11 For updates you need to download the change files for each country
12 once per day and apply them **separately** using
14 ./utils/update.php --import-diff <filename> --index
16 See [this issue](https://github.com/openstreetmap/Nominatim/issues/60#issuecomment-18679446)
17 for a script that runs the updates using osmosis.
19 ### My website shows: `XML Parsing Error: XML or text declaration not at start of entity Location</code>.`
21 Make sure there are no spaces at the beginning of your `settings/local.php` file.
26 ### I accidentally killed the import process after it has been running for many hours. Can it be resumed?
28 It is possible if the import already got to the indexing stage.
29 Check the last line of output that was logged before the process
30 was killed. If it looks like this:
33 Done 844 in 13 @ 64.923080 per second - Rank 26 ETA (seconds): 7.886255
35 then you can resume with the following command:
38 ./utils/setup.php --index --create-search-indices --create-country-names
41 If the reported rank is 26 or higher, you can also safely add `--index-noanalyse`.
44 ### When running the setup.php script I get a warning:
45 `PHP Warning: file_get_contents(): open_basedir restriction in effect.`
47 You need to adjust the [open_basedir](http://www.php.net/manual/en/ini.core.php#ini.open-basedir) setting
48 in your PHP configuration (php.ini file). By default this setting may look like this:
50 open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/
52 Either add reported directories to the list or disable this setting temporarily by
53 dding ";" at the beginning of the line. Don't forget to enable this setting again
54 once you are done with the PHP command line operations.
57 ### The Apache log contains lots of PHP warnings like this:
58 `PHP Warning: date_default_timezone_set() function.`
60 You should set the default time zone as instructed in the warning in
61 your `php.ini` file. Find the entry about timezone and set it to
64 ; Defines the default timezone used by the date functions
65 ; http://php.net/date.timezone
66 date.timezone = 'America/Denver'
71 echo "date.timezone = 'America/Denver'" > /etc/php.d/timezone.ini
74 ### When running the import I get a version mismatch:
75 `COPY_END for place failed: ERROR: incompatible library "/opt/Nominatim/module/nominatim.so": version mismatch`
77 pg_config seems to use bad includes sometimes when multiple versions
78 of PostgreSQL are available in the system. Make sure you remove the
79 server development libraries (`postgresql-server-dev-9.1` on Ubuntu)
80 and recompile (`cmake .. && make`).
83 ### I see the error: `function transliteration(text) does not exist`
85 Reinstall the nominatim functions with `setup.php --create--functions`
86 and check for any errors, e.g. a missing `nominatim.so` file.
89 ### The website shows: `Could not get word tokens`
91 The server cannot access your database. Add `&debug=1` to your URL
92 to get the full error message.
95 ### On CentOS the website shows `could not connect to server: No such file or directory`
97 On CentOS v7 the PostgreSQL server is started with `systemd`.
98 Check if `/usr/lib/systemd/system/httpd.service` contains a line `PrivateTmp=true`.
99 If so then Apache cannot see the `/tmp/.s.PGSQL.5432` file. It's a good security feature,
100 so use the [preferred solution](../appendix/Install-on-Centos-7/#adding-selinux-security-settings).
102 However, you can solve this the quick and dirty way by commenting out that line and then run
104 sudo systemctl daemon-reload
105 sudo systemctl restart httpd
108 ### Setup.php fails with the message: `DB Error: extension not found`
110 Make sure you have the Postgres extensions hstore and postgis installed.
111 See the installation instruction for a full list of required packages.
113 ### When running the setup.php script I get a error:
114 `Cannot redeclare getDB() (previously declared in /your/path/Nominatim/lib/db.php:4)`
116 The message is a bit misleading as PHP needs to load the file `DB.php` and
117 instead re-loads Nominatim's `db.php`. To solve this make sure you
118 have the [http://pear.php.net/package/DB/ Pear module 'DB'] installed.
122 ### I forgot to delete the flatnodes file before starting an import.
124 That's fine. For each import the flatnodes file get overwritten.
125 See https://help.openstreetmap.org/questions/52419/nominatim-flatnode-storage
126 for more information.