NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hi. I followed the installation instructions with a fresh debian 11. php version is 7.4.21. Here is my apache configuration:

<VirtualHost *:80>
    ServerName geo.domain.tld

    <Directory "/usr/local/lib/nominatim/lib-php/website/">
        Options FollowSymLinks MultiViews
        AddType text/html   .php
        DirectoryIndex search.php
        Require all granted
    </Directory>

    DocumentRoot /usr/local/lib/nominatim/lib-php/website/
</VirtualHost>

Here is the error log generated when trying to access the domain:

[Thu Aug 19 14:26:42.482410 2021] [php7:warn] [pid 438204] [client ::1:34376] PHP Warning:  Use of undefined constant CONST_LibDir - assumed 'CONST_LibDir' (this will throw an Error in a future version of PHP) in /usr/local/lib/nominatim/lib-php/website/search.php on line 3
[Thu Aug 19 14:26:42.482778 2021] [php7:warn] [pid 438204] [client ::1:34376] PHP Warning:  require_once(CONST_LibDir/init-website.php): failed to open stream: No such file or directory in /usr/local/lib/nominatim/lib-php/website/search.php on line 3
[Thu Aug 19 14:26:42.482792 2021] [php7:error] [pid 438204] [client ::1:34376] PHP Fatal error:  require_once(): Failed opening required 'CONST_LibDir/init-website.php' (include_path='.:/usr/share/php') in /usr/local/lib/nominatim/lib-php/website/search.php on line 3

Is there something wrong with my installation?

asked 19 Aug '21, 13:37

azmeuk's gravatar image

azmeuk
11112
accept rate: 0%


In the Apache configuration you need to use your project directory, e.g. /srv/nominatim (see https://www.nominatim.org/release-docs/3.7.2/admin/Deployment/#nominatim-with-apache). In previous Nominatim versions that was called the "build" directory. It was created during the Nominatim setup already.

If you can't find website/*.php files in the project directory try running

nominatim refresh --website

in the project directory.

The website/*.php files in the project directory have various @define('CONST_... lines near the top, the files in /usr/local/lib/nominatim/lib-php/website/ don't and the nominatim refresh adds those lines.

permanent link

answered 19 Aug '21, 17:56

mtmail's gravatar image

mtmail
4.8k1574
accept rate: 27%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×689
×34

question asked: 19 Aug '21, 13:37

question was seen: 4,841 times

last updated: 19 Aug '21, 17:56

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum