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

I want to embed Search box on My Own Map on my tile server. i have followed reference from http://open.mapquestapi.com/npi/ to install nominatim pre index. but i have problem when execute command :

../utils/setup.php --create-db --create-functions --create-minimal-tables

Create DB
Create DB (2)
PHP Warning:  log() expects parameter 1 to be double, string given in /home/user/Map/src/nominatim/lib/
lib.php on line 6
unable to find /usr/share/postgresql/9.0/contrib/_int.sql

I use postgres 8.4 on my machine.Error message is like that script wrong read a postgresql folder. How to solve this issue ?

asked 30 Dec '11, 10:21

MIftakhul%20Anwar's gravatar image

MIftakhul Anwar
11224
accept rate: 0%

(02 Jan '12, 03:25) h4ck3rm1k3

try again without --create-db

(02 Jan '12, 04:04) h4ck3rm1k3

You will have to change the value of CONST_Path_Postgresql_Contrib in your settings/settings.php file to point to the directory where your _int.sql resides. Make sure to install the proper PostgreSQL contrib package first (e.g. postgresql-contrib-8.4 on Ubuntu Lucid).

permanent link

answered 30 Dec '11, 10:28

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Yes, i have change that value on setting.php.

i have execute again

../utils/setup.php --create-db --create-functions --create-minimal-tables

But on end of line of output, i have got warning like bellow .

[output]

INSERT 0 1
INSERT 0 1
INSERT 0 1
...
SET
SET
CREATE TABLE
SET
SET
SET
SET
SET
SET
SET
SET
CREATE TABLE
ALTER TABLE
Functions
PHP Warning:  log() expects parameter 1 to be double, string given in /home/user/Map/src/nominatim/lib/lib.php on line 6
nominatim module not built

i'm running script as user which have role on postgresql but not as postgres. is it problem ?

This is line 6 on lib.php

 function fail($sError, $sUserError = false)
    {
            if (!$sUserError) $sUserError = $sError;
            log('ERROR:'.$sError);  //line 6
            echo $sUserError."\n";
            exit;
    }
(02 Jan '12, 02:13) MIftakhul Anwar

I have continuing step and now i have on generating website step.

I have execute this script as described in reference: ../setup.php --create-website /var/www/html

NOw i have publish it on http://www.osmosa.net/search But when i access web, i get error on apache log.

[Tue Jan 03 21:27:02 2012] [error] [client 118.137.0.31] PHP Notice:  Undefined index: PATH_INFO in /home/user/Map/src/nominatim/website/search.php on line 95

[Tue Jan 03 21:27:02 2012] [error] [client 118.137.0.31] PHP Notice:  Use of undefined constant CONST_Search_AreaPolygons - assumed 'CONST_Search_AreaPolygons' in /home/user/Map/src/nominatim/lib/template/search-html.php on line 327

i have checked on /home/user/Map/src/nominatim/website/search.php on line 95, i get script bellow :

 $sQuery = (isset($_GET['q'])?trim($_GET['q']):'');
    if (!$sQuery && $_SERVER['PATH_INFO'] && $_SERVER['PATH_INFO'][0] == '/')  /* >> line 95
    {
            $sQuery = substr($_SERVER['PATH_INFO'], 1);

            // reverse order of '/' seperated string
            $aPhrases = explode('/', $sQuery);
            $aPhrases = array_reverse($aPhrases); 
            $sQuery = join(', ',$aPhrases);
    }

Then i check on /home/user/Map/src/nominatim/lib/template/search-html.php line 327.and i get this line one

<?php if (CONST_Search_AreaPolygons) { ?><td style="width:100px;"><input type="checkbox" value="1" name="polygon" <?php if ($bSh$
<td style="text-align:right;">Data: <?php echo $sDataDate; ?></td>
<td style="text-align:right;">
<a href="http://wiki.openstreetmap.org/wiki/Nominatim" target="_blank">Documentation</a> | <a href="http://wiki.openstreetmap.org/wiki/Nominatim/FAQ" 
target="_blank">FAQ</a></td>

<?php }

Then i see on nominatim folder /setting/setting.php and i get that constanta have value :

@define('CONST_Search_AreaPolygons_Enabled', true);

how i can set PATH_INFO which now is undefined ?

Thanks

(03 Jan '12, 14:54) MIftakhul Anwar

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
×165
×28
×2

question asked: 30 Dec '11, 10:21

question was seen: 7,300 times

last updated: 28 Feb '12, 14:22

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