From OpenStreetMap Wiki
Jump to: navigation, search

When running the setup.php script I get a warning: PHP Warning: file_get_contents(): open_basedir restriction in effect.

You need to adjust the open_basedir setting in your PHP configuration (php.ini file). By default this setting may look like this:

 open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/

Either add reported directories to the list or disable this setting temporarily by adding ";" at the beginning of the line. Don't forget to enable this setting again once you are done with the PHP command line operations.

The Apache log contains lots of PHP warnings like this: PHP Warning: date_default_timezone_set() function.

You should set the default time zone as instructed in the warning in your php.ini file. find the entry about timezone and set it to something like this:

 ; Defines the default timezone used by the date functions
 date.timezone = 'America/Denver'


echo "date.timezone = 'America/Denver'" > /etc/php.d/timezone.ini version mismatch

  COPY_END for place failed: ERROR: incompatible library "/opt/Nominatim/module/": version mismatch

pg_config seems to use bad includes sometimes when multiple versions of PostgreSQL are available in the system. Make sure you remove the server development libraries (postgresql-server-dev-9.1 on Ubuntu) and recompile (./configure && make).

function transliteration(text) does not exist

Reinstall the nominatim functions with setup.php and check for any errors, e.g. a missing `` file.

 ./utils/setup.php --create-functions --enable-diff-updates

I accidentally killed the import process after it has been running for many hours. Can it be resumed?

It is possible if the import already got to the indexing stage. Check the last line of output that was logged before the process was killed. If it looks like this:

  Done 844 in 13 @ 64.923080 per second - Rank 26 ETA (seconds): 7.886255

then you can resume with the following command:

  ./utils/setup.php --index --create-search-indices

If the reported rank is 26 or higher, you can also safely add --index-noanalyse.

If you want to speed up the process, you can use -–threads 4 depending how many cpus you want to use.

I get an error XML Parsing Error: XML or text declaration not at start of entity Location.

Make sure there are no spaces at the beginning of your settings/local.php file.

The browser shows Could not get word tokens

If you have an Apache user different than www-data (for example on CentOS the default is apache) then rename the www-data user.

 psql -d nominatim -c 'ALTER USER "www-data" RENAME TO "apache"'

If the error persists, make sure the user has read (select) access in the database

 psql -d nominatim
 GRANT usage ON SCHEMA public TO "www-data";

The browser shows could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?"

See Nominatim/Installation/CentOS#PostgreSQL_UNIX_Socket_Location.

On CentOS v7 the PostgreSQL server is started with `systemd`. Check if `/usr/lib/systemd/system/httpd.service` contains a line `PrivateTmp=true`. If so then Apache cannot see the `/tmp/.s.PGSQL.5432` file. It's a good security feature, so use the preferred solution

However, you can solve this the quick and dirty way by commenting out that line and then run

 sudo systemctl daemon-reload
 sudo systemctl restart httpd

Osmosis returns error Thread for task 1-read-replication-lag failed

Check if you're running the latest version of Osmosis (osmosis --version | grep version). For example apt-get install osmosis on Ubuntu 14 LTE installs version 0.40 while you should have at least 0.43 installed.

DB Error: extension not found

Make sure you have the Postgres extensions hstore and postgis installed. On Debian/Ubuntu, install the following packages: postgresql-contrib and postgresql-9.x-postgis-2.x (version depends on the available Postgres).

When running the setup.php script I get a error: Cannot redeclare getDB() (previously declared in /your/path/Nominatim/lib/db.php:4)

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

I forgot to delete the flatnodes file before starting an import

That's fine. For each import the flatnodes file get overwritten. longer explanation