I work in project of geocoding so Ii want to import the OpenStreetMap data. I created a database and name it Nominatim and I tried this command:

sudo ./utils/setup.php --osm-file morocco-latest.osm.pbf --all –osm2pgsql-cache 18000 2>&1 | tee setup.log

It shows me this message:


ERROR: database already exists ( pgsql : // @/nominatim)

Now when I delete my database Nominatim it shows this error message:

ERROR: unable to find /usr/pgsql-9.3/share/contrib/postgis-1.5/postgis.sq

BTW I installed postgres with all the packages.

Any idea what the issue is?

  • crosspost: stackoverflow.com/questions/29819170/…
    – scai
    Commented Apr 23, 2015 at 9:35
  • The installation instructions don't say anything about creating the Nominatim database yourself. And postgis.sql belongs to the postgis package, try reinstalling it.
    – scai
    Commented Apr 23, 2015 at 9:42
  • I followed another tutorial that indicate to create a database..So now how can i corresct the second error ? i have that file (postgis.sql) but not in that direction
    – YSN KHL
    Commented Apr 23, 2015 at 9:49

2 Answers 2


The main problem seams to be that your configuration is incorrect.

you have to set the correct postgre and postgis version you installed in settings/local.php:

   @define('CONST_Postgresql_Version', '9.3');
   @define('CONST_Postgis_Version', '2.1');

Your error line shows, how nominatim tries to use the setup postgre 9.3 in combination with postgis 1.5. This combination isn't supported: https://trac.osgeo.org/postgis/wiki/UsersWikiPostgreSQLPostGIS

you should install postgis 2.1 for postgre 9.3


just change the database name in the following location


Edit the database name in this file settings.php.

@define('CONST_Database_DSN', 'pgsql://@/nominatim'); 

change with your database name

@define('CONST_Database_DSN', 'pgsql://@/nominatimMorocco');

If you change your database name here than you also need to change following nominatim installation command.

./utils/specialphrases.php --countries > specialphrases_countries.sql
 psql -d nominatimMorocco -f specialphrases_countries.sql

./utils/specialphrases.php --wiki-import > specialphrases.sql
 psql -d nominatimMorocco -f specialphrases.sql

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.