From: Sarah Hoffmann Date: Sun, 9 Jun 2019 09:04:47 +0000 (+0200) Subject: Merge pull request #1381 from mtmail/faq-entry-about-managed-database-services X-Git-Tag: v3.4.0~38 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/a09f2a698707c366a0e93a81c84268a83bf7d7ea?hp=11e0d9ec14d0dd6afbcccd3b3867496e0f09762e Merge pull request #1381 from mtmail/faq-entry-about-managed-database-services FAQ entry about managed database services --- diff --git a/docs/admin/Faq.md b/docs/admin/Faq.md index 36a6c45e..485ba25b 100644 --- a/docs/admin/Faq.md +++ b/docs/admin/Faq.md @@ -24,14 +24,14 @@ If the reported rank is 26 or higher, you can also safely add `--index-noanalyse ### PHP "open_basedir restriction in effect" warnings - `PHP Warning: file_get_contents(): open_basedir restriction in effect.` + PHP Warning: file_get_contents(): open_basedir restriction in effect. -You need to adjust the [open_basedir](http://www.php.net/manual/en/ini.core.php#ini.open-basedir) setting +You need to adjust the [open_basedir](https://www.php.net/manual/en/ini.core.php#ini.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 +Either add reported directories to the list or disable this setting temporarily by dding ";" at the beginning of the line. Don't forget to enable this setting again once you are done with the PHP command line operations. @@ -44,9 +44,9 @@ The Apache log may contain lots of PHP warnings like this: 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 - ; http://php.net/date.timezone + ; https://php.net/date.timezone date.timezone = 'America/Denver' Or @@ -91,11 +91,11 @@ vboxfs. ### nominatim UPDATE failed: ERROR: buffer 179261 is not owned by resource owner Portal -Several users [reported this](https://github.com/openstreetmap/Nominatim/issues/1168) during the initial import of the database. It's -something Postgresql internal Nominatim doesn't control. And Postgresql forums +Several users [reported this](https://github.com/openstreetmap/Nominatim/issues/1168) during the initial import of the database. It's +something PostgreSQL internal Nominatim doesn't control. And PostgreSQL forums suggest it's threading related but definitely some kind of crash of a process. Users reported either rebooting the server, different hardware or just trying -the import again worked. +the import again worked. ### The website shows: "Could not get word tokens" @@ -148,7 +148,7 @@ Example error message CONTEXT: PL/pgSQL function make_standard_name(text) line 5 at assignment] ``` -The Postgresql database, i.e. user postgres, needs to have access to that file. +The PostgreSQL database, i.e. user `postgres`, needs to have access to that file. The permission need to be read & executable by everybody, e.g. @@ -163,7 +163,7 @@ When running SELinux, make sure that the ### Setup.php fails with "DB Error: extension not found" -Make sure you have the Postgres extensions hstore and postgis installed. +Make sure you have the PostgreSQL extensions "hstore" and "postgis" installed. See the installation instruction for a full list of required packages. @@ -173,7 +173,7 @@ See the installation instruction for a full list of required packages. 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'](http://pear.php.net/package/DB/) installed. +have the [Pear module 'DB'](https://pear.php.net/package/DB/) installed. sudo pear install DB @@ -198,7 +198,7 @@ For updates you need to download the change files for each country once per day and apply them **separately** using ./utils/update.php --import-diff --index - + See [this issue](https://github.com/openstreetmap/Nominatim/issues/60#issuecomment-18679446) for a script that runs the updates using osmosis. diff --git a/docs/admin/Import-and-Update.md b/docs/admin/Import-and-Update.md index 3d090597..ad777364 100644 --- a/docs/admin/Import-and-Update.md +++ b/docs/admin/Import-and-Update.md @@ -36,7 +36,7 @@ the directory exists. There should be at least 40GB of free space. ### Wikipedia rankings Wikipedia can be used as an optional auxiliary data source to help indicate -the importance of osm features. Nominatim will work without this information +the importance of OSM features. Nominatim will work without this information but it will improve the quality of the results if this is installed. This data is available as a binary download: @@ -45,7 +45,7 @@ This data is available as a binary download: wget https://www.nominatim.org/data/wikipedia_redirect.sql.bin Combined the 2 files are around 1.5GB and add around 30GB to the install -size of nominatim. They also increase the install time by an hour or so. +size of Nominatim. They also increase the install time by an hour or so. *NOTE:* you'll need to download the Wikipedia rankings before performing the initial import of the data if you want the rankings applied to the @@ -53,7 +53,7 @@ loaded data. ### UK postcodes -Nominatim can use postcodes from an external source to improve searches that involve a UK postcode. This data can be optionally downloaded: +Nominatim can use postcodes from an external source to improve searches that involve a UK postcode. This data can be optionally downloaded: cd $NOMINATIM_SOURCE_DIR/data wget https://www.nominatim.org/data/gb_postcode_data.sql.gz @@ -77,7 +77,7 @@ below. There are also Please be aware that some extracts are not cut exactly along the country boundaries. As a result some parts of the boundary may be missing which means -that cannot compute the areas for some administrative areas. +that Nominatim cannot compute the areas for some administrative areas. ### Dropping Data Required for Dynamic Updates @@ -99,7 +99,7 @@ database or reuse the space later. If you only want to use the Nominatim database for reverse lookups or if you plan to use the installation only for exports to a -[photon](http://photon.komoot.de/) database, then you can set up a database +[photon](https://photon.komoot.de/) database, then you can set up a database without search indexes. Add `--reverse-only` to your setup command above. This saves about 5% of disk space. @@ -121,7 +121,7 @@ import styles available which only read selected data: The style can be changed with the configuration `CONST_Import_Style`. -To give you an idea of the impact of using the different style, the table +To give you an idea of the impact of using the different styles, the table below gives rough estimates of the final database size after import of a 2018 planet and after using the `--drop` option. It also shows the time needed for the import on a machine with 32GB RAM, 4 CPUS and SSDs. Note that @@ -136,7 +136,7 @@ address | 59h | 500 GB | 260 GB full | 80h | 575 GB | 300 GB You can also customize the styles further. For an description of the -style format see [the developement section](../develop/Import.md). +style format see [the development section](../develop/Import.md). ## Initial import of the data @@ -157,7 +157,7 @@ about the same size as the file you are importing but never more than 2/3 of RAM available. If your machine starts swapping reduce the size. Computing word frequency for search terms can improve the performance of -forward geocoding in particular under high load as it helps Postgres' query +forward geocoding in particular under high load as it helps PostgreSQL's query planner to make the right decisions. To recompute word counts run: ```sh @@ -195,7 +195,7 @@ entire US adds about 10GB to your database. `data-source/us-tiger/README.md` explains how the data got preprocessed. - 2. Import the data into your Nominatim database: + 2. Import the data into your Nominatim database: ./utils/setup.php --import-tiger-data @@ -212,7 +212,7 @@ entire US adds about 10GB to your database. ## Updates -There are many different possibilities to update your Nominatim database. +There are many different ways to update your Nominatim database. The following section describes how to keep it up-to-date with Pyosmium. For a list of other methods see the output of `./utils/update.php --help`. @@ -241,7 +241,7 @@ to update using the global minutely diffs. If you want a different update source you will need to add some settings to `settings/local.php`. For example, to use the daily country extracts -diffs for Ireland from geofabrik add the following: +diffs for Ireland from Geofabrik add the following: // base URL of the replication service @define('CONST_Replication_Url', 'https://download.geofabrik.de/europe/ireland-and-northern-ireland-updates'); @@ -257,7 +257,7 @@ To set up the update process now run the following command: It outputs the date where updates will start. Recheck that this date is what you expect. -The --init-updates command needs to be rerun whenever the replication service +The `--init-updates` command needs to be rerun whenever the replication service is changed. #### Updating Nominatim diff --git a/docs/admin/Installation.md b/docs/admin/Installation.md index 7ce1ea67..5b7f8173 100644 --- a/docs/admin/Installation.md +++ b/docs/admin/Installation.md @@ -34,28 +34,28 @@ osm2pgsql README for additional dependencies required for compiling osm2pgsql. For running tests: * [behave](http://pythonhosted.org/behave/) - * [Psycopg2](http://initd.org/psycopg) + * [Psycopg2](https://initd.org/psycopg) * [nose](https://nose.readthedocs.io) * [phpunit](https://phpunit.de) For running Nominatim: - * [PostgreSQL](http://www.postgresql.org) (9.3 or later) - * [PostGIS](http://postgis.refractions.net) (2.2 or later) - * [PHP](http://php.net) (7.0 or later) + * [PostgreSQL](https://www.postgresql.org) (9.3 or later) + * [PostGIS](https://postgis.org) (2.2 or later) + * [PHP](https://php.net) (7.0 or later) * PHP-pgsql * PHP-intl (bundled with PHP) - * [PEAR::DB](http://pear.php.net/package/DB) + * [PEAR::DB](https://pear.php.net/package/DB) * a webserver (apache or nginx are recommended) For running continuous updates: - * [pyosmium](http://osmcode.org/pyosmium/) + * [pyosmium](https://osmcode.org/pyosmium/) ### Hardware A minimum of 2GB of RAM is required or installation will fail. For a full -planet import 32GB of RAM or more strongly are recommended. +planet import 32GB of RAM or more are strongly recommended. For a full planet install you will need at least 700GB of hard disk space (take into account that the OSM database is growing fast). SSD disks diff --git a/docs/admin/Migration.md b/docs/admin/Migration.md index 0cfe2960..ebad9c48 100644 --- a/docs/admin/Migration.md +++ b/docs/admin/Migration.md @@ -3,7 +3,7 @@ This page describes database migrations necessary to update existing databases to newer versions of Nominatim. -SQL statements should be executed from the postgres commandline. Execute +SQL statements should be executed from the PostgreSQL commandline. Execute `psql nominatim` to enter command line mode. diff --git a/docs/api/Details.md b/docs/api/Details.md index 027138a9..b5405c83 100644 --- a/docs/api/Details.md +++ b/docs/api/Details.md @@ -40,7 +40,7 @@ See [Place Output Formats](Output.md) for details on each format. (Default: html * `json_callback=` -Wrap json output in a callback function (JSONP) i.e. `()`. +Wrap JSON output in a callback function (JSONP) i.e. `()`. Only has an effect for JSON output formats. * `pretty=[0|1]` diff --git a/docs/api/Faq.md b/docs/api/Faq.md index 6bc5b5e8..86f0e783 100644 --- a/docs/api/Faq.md +++ b/docs/api/Faq.md @@ -7,11 +7,11 @@ Nominatim computes the address from two sources in the OpenStreetMap data: from administrative boundaries and from place nodes. Boundaries are the more useful source. They precisely describe an area. So it is very clear for -Nominatim if a point belongs to an area of not. Place nodes are more complicated. -These are only points without any precise extend. So Nominatim has to take a -guess and assume that an address belongs to the closest place nose it can find. +Nominatim if a point belongs to an area or not. Place nodes are more complicated. +These are only points without any precise extent. So Nominatim has to take a +guess and assume that an address belongs to the closest place node it can find. In an ideal world, Nominatim would not need the place nodes but there are -many places on earth where there are not precise boundaries available for +many places on earth where there are no precise boundaries available for all parts that make up an address. This is in particular true for the more local address parts, like villages and suburbs. Therefore it is not possible to completely dismiss place nodes. And sometimes they sneak in where they @@ -21,7 +21,7 @@ As a OpenStreetMap mapper, you can improve the situation in two ways: if you see a place node for which already an administrative area exists, then you should _link_ the two by adding the node with a 'label' role to the boundary relation. If there is no administrative area, you can add the approximate -extend of the place and tag it place= as well. +extent of the place and tag it place= as well. #### 2. When doing reverse search, the address details have parts that don't contain the point I was looking up. @@ -30,7 +30,7 @@ Reverse does not give you the address of the point you asked for. Reverse returns the closest object to the point you asked for and then returns the address of that object. Now, if you are close to a border, then the closest object may be across that border. When Nominatim then returns the address, -contains the county/state/country across the border. +it contains the county/state/country across the border. #### 3. I get different counties/states/countries when I change the zoom parameter in the reverse query. How is that possible? @@ -45,12 +45,12 @@ sometimes the other for the closest point. Nominatim assigns each map feature one country. Those outside any administrative boundaries are assigned a special no-country. Continents or other super-national -administrations (e.g. European Union, NATO, Custom unions) are not supported, +administrations (e.g. European Union, NATO, Custom unions) are not supported, see also [Administrative Boundary](https://wiki.openstreetmap.org/wiki/Tag:boundary%3Dadministrative#Super-national_administrations). #### 5. Can you return the timezone? -See this separate OpenStreetMap-based project [Timezone Boundary Builder](https://github.com/evansiroky/timezone-boundary-builder) +See this separate OpenStreetMap-based project [Timezone Boundary Builder](https://github.com/evansiroky/timezone-boundary-builder). #### 6. I want to download a list of streets/restaurants of a city/region diff --git a/docs/api/Lookup.md b/docs/api/Lookup.md index 57bf7b5f..36672ee7 100644 --- a/docs/api/Lookup.md +++ b/docs/api/Lookup.md @@ -25,7 +25,7 @@ See [Place Output Formats](Output.md) for details on each format. (Default: xml) * `json_callback=` -Wrap json output in a callback function (JSONP) i.e. `()`. +Wrap JSON output in a callback function (JSONP) i.e. `()`. Only has an effect for JSON output formats. ### Output details diff --git a/docs/api/Output.md b/docs/api/Output.md index 4aa4d298..df78ed7d 100644 --- a/docs/api/Output.md +++ b/docs/api/Output.md @@ -1,6 +1,6 @@ # Place Output -The [\reverse](Reverse.md), [\search](Search.md) and [\lookup](Lookup.md) +The [/reverse](Reverse.md), [/search](Search.md) and [/lookup](Lookup.md) API calls produce very similar output which is explained in this section. There is one section for each format which is selectable via the `format` parameter. @@ -70,7 +70,7 @@ This is the same as the JSON format with two changes: ### GeoJSON -This format follows the [RFC7946](http://geojson.org). Every feature includes +This format follows the [RFC7946](https://geojson.org). Every feature includes a bounding box (`bbox`). The feature list has the following fields: @@ -83,7 +83,7 @@ The feature list has the following fields: * `importance` - computed importance rank * `icon` - link to class icon (if available) * `address` - dictionary of address details (only with `addressdetails=1`) - * `extratags` - dictionary with additional useful tags like website or maxspeed + * `extratags` - dictionary with additional useful tags like `website` or `maxspeed` (only with `extratags=1`) * `namedetails` - dictionary with full list of available names including ref etc. @@ -120,7 +120,7 @@ formats depending on the API call. ``` @@ -232,7 +232,7 @@ permanent for later use. The combination `osm_type`+`osm_id` is slighly better but remember in OpenStreetMap mappers can delete, split, recreate places (and those -get a new `osm_id`), there is no link between those old and new id. +get a new `osm_id`), there is no link between those old and new ids. Places can also change their meaning without changing their `osm_id`, e.g. when a restaurant is retagged as supermarket. For a more in-depth discussion see [Permanent ID](https://wiki.openstreetmap.org/wiki/Permanent_ID). diff --git a/docs/api/Reverse.md b/docs/api/Reverse.md index 82b4e6f3..13805fd4 100644 --- a/docs/api/Reverse.md +++ b/docs/api/Reverse.md @@ -22,7 +22,7 @@ There are two ways how the requested location can be specified: A specific OSM node(N), way(W) or relation(R) to return an address for. -In both cases exactly one object is returned. The two input paramters cannot +In both cases exactly one object is returned. The two input parameters cannot be used at the same time. Both accept the additional optional parameters listed below. @@ -34,7 +34,7 @@ See [Place Output Formats](Output.md) for details on each format. (Default: html * `json_callback=` -Wrap json output in a callback function ([JSONP](https://en.wikipedia.org/wiki/JSONP)) i.e. `()`. +Wrap JSON output in a callback function ([JSONP](https://en.wikipedia.org/wiki/JSONP)) i.e. `()`. Only has an effect for JSON output formats. ### Output details @@ -135,7 +135,7 @@ This overrides the specified machine readable format. (Default: 0) B72 United Kingdom gb - + ``` @@ -146,7 +146,7 @@ This overrides the specified machine readable format. (Default: 0) ```json { "place_id":"134140761", - "licence":"Data © OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright", + "licence":"Data © OpenStreetMap contributors, ODbL 1.0. https:\/\/www.openstreetmap.org\/copyright", "osm_type":"way", "osm_id":"280940520", "lat":"-34.4391708", diff --git a/docs/api/Search.md b/docs/api/Search.md index 4b9d773c..4a35e62a 100644 --- a/docs/api/Search.md +++ b/docs/api/Search.md @@ -1,6 +1,6 @@ # Search queries -The search API allows to look up a location from a textual description. +The search API allows you to look up a location from a textual description. Nominatim supports structured as well as free-form search queries. The search query may also contain @@ -46,7 +46,7 @@ In this form, the query may be given through two different sets of parameters: Structured requests are faster but are less robust against alternative OSM tagging schemas. **Do not combine with** `q=` **parameter**. -All three query forms accept the additional paramters listed below. +All three query forms accept the additional parameters listed below. ### Output format @@ -56,7 +56,7 @@ See [Place Output Formats](Output.md) for details on each format. (Default: html * `json_callback=` -Wrap json output in a callback function ([JSONP](https://en.wikipedia.org/wiki/JSONP)) i.e. `()`. +Wrap JSON output in a callback function ([JSONP](https://en.wikipedia.org/wiki/JSONP)) i.e. `()`. Only has an effect for JSON output formats. ### Output details @@ -175,12 +175,12 @@ This overrides the specified machine readable format. (Default: 0) ```xml - 135 Pilkington Avenue diff --git a/docs/develop/Import.md b/docs/develop/Import.md index e733c6fd..5a323d26 100644 --- a/docs/develop/Import.md +++ b/docs/develop/Import.md @@ -24,7 +24,7 @@ with multiple tags that may constitute a principal tag. Take for example a motorway bridge. In OSM, this would be a way which is tagged with `highway=motorway` and `bridge=yes`. This way would appear in the `place` table once with `class` of `highway` and once with a `class` of `bridge`. Thus the -*uique key* for `place` is (`osm_type`, `osm_id`, `class`). +*unique key* for `place` is (`osm_type`, `osm_id`, `class`). ## Configuring the Import @@ -55,8 +55,8 @@ suffix match can be defined similarly with a string that starts with a `*`. Any other string constitutes an exact match. The second part of the rules defines a list of values and the properties that -apply to a successful match. Value strings may be either empty, which again -means that thy match against any value, or describe an exact match. Prefix +apply to a successful match. Value strings may be either empty, which +means that they match any value, or describe an exact match. Prefix or suffix matching of values is not possible. For a rule to match, it has to find a valid combination of keys and values. The @@ -66,7 +66,7 @@ The rules in a configuration file are processed sequentially and the first match for each tag wins. A rule where key and value are the empty string is special. This defines the -fallback when none of the rules matches. The fallback is always used as a last +fallback when none of the rules match. The fallback is always used as a last resort when nothing else matches, no matter where the rule appears in the file. Defining multiple fallback rules is not allowed. What happens in this case, is undefined. @@ -121,17 +121,17 @@ One or more of the following properties may be given for each tag: * `address` - At tag to the list of address tags. If the tag starts with `addr:` or + Add tag to the list of address tags. If the tag starts with `addr:` or `is_in:`, then this prefix is cut off before adding it to the list. * `postcode` - At the value as a postcode to the address tags. If multiple tags are + Add the value as a postcode to the address tags. If multiple tags are candidate for postcodes, one wins out and the others are dropped. * `country` - At the value as a country code to the address tags. The value must be a + Add the value as a country code to the address tags. The value must be a two letter country code, otherwise it is ignored. If there are multiple tags that match, then one wins out and the others are dropped. diff --git a/docs/develop/Ranking.md b/docs/develop/Ranking.md index 03704937..776de8f5 100644 --- a/docs/develop/Ranking.md +++ b/docs/develop/Ranking.md @@ -21,7 +21,7 @@ Usually only administrative boundaries and place nodes and areas are eligible to be part of an address. All other objects have an address rank of 0. -Note that the search rank of a place place a role in the address computation +Note that the search rank of a place plays a role in the address computation as well. When collecting the places that should make up the address parts then only places are taken into account that have a lower address rank than the search rank of the base object. @@ -37,7 +37,7 @@ into the database. There are a few hard-coded rules for the assignment: * highway nodes * landuse that is not an area -Other than that, the ranks can be freely assigned via the json file +Other than that, the ranks can be freely assigned via the JSON file defined with `CONST_Address_Level_Config` according to their type and the country they are in. @@ -78,12 +78,13 @@ definition is used as a fallback, when nothing more specific for a given country exists. `tags` contains the ranks for key/value pairs. The ranks can be either a -single number, in which case they are to search and address rank, or a tuple +single number, in which case they are the search and address rank, or an array of search and address rank (in that order). The value may be left empty. Then the rank is used when no more specific value is found for the given key. -Countries and key/value combination may appear in multiple defintions. Just +Countries and key/value combination may appear in multiple definitions. Just make sure that each combination of counrty/key/value appears only once per file. Otherwise the import will fail with a UNIQUE INDEX constraint violation on import. + diff --git a/docs/develop/overview.md b/docs/develop/overview.md index 179eeb0b..c0a37a41 100644 --- a/docs/develop/overview.md +++ b/docs/develop/overview.md @@ -1,6 +1,6 @@ # Basic Architecture -Nominatim provides geocoding based on OpenStreetMap data. It uses a Postgresql +Nominatim provides geocoding based on OpenStreetMap data. It uses a PostgreSQL database as a backend for storing the data. There are three basic parts to Nominatim's architecture: the data import, @@ -15,10 +15,10 @@ the import can be found in the database table `place`. The __address computation__ or __indexing__ stage takes the data from `place` and adds additional information needed for geocoding. It ranks the places by importance, links objects that belong together and computes addresses and -the search index. Most of this work is done in Pl/pqSQL via database triggers +the search index. Most of this work is done in PL/pgSQL via database triggers and can be found in the file `sql/functions.sql`. -The __search frontend__ implements the actual API. It takes queries for -search and reverse geocoding queries from the user, looks up the data and +The __search frontend__ implements the actual API. It takes search +and reverse geocoding queries from the user, looks up the data and returns the results in the requested format. This part is written in PHP and can be found in the `lib/` and `website/` directories. diff --git a/lib/init-website.php b/lib/init-website.php index 67fb52d1..23c15ba8 100644 --- a/lib/init-website.php +++ b/lib/init-website.php @@ -21,6 +21,7 @@ function exception_handler_html($exception) http_response_code($exception->getCode()); header('Content-type: text/html; charset=UTF-8'); include(CONST_BasePath.'/lib/template/error-html.php'); + exit(); } function exception_handler_json($exception) @@ -28,6 +29,7 @@ function exception_handler_json($exception) http_response_code($exception->getCode()); header('Content-type: application/json; charset=utf-8'); include(CONST_BasePath.'/lib/template/error-json.php'); + exit(); } function exception_handler_xml($exception) @@ -36,17 +38,51 @@ function exception_handler_xml($exception) header('Content-type: text/xml; charset=utf-8'); echo ''."\n"; include(CONST_BasePath.'/lib/template/error-xml.php'); + exit(); } +function shutdown_exception_handler_html() +{ + $error = error_get_last(); + if ($error !== null && $error['type'] === E_ERROR) { + exception_handler_html(new Exception($error['message'], 500)); + } +} + +function shutdown_exception_handler_xml() +{ + $error = error_get_last(); + if ($error !== null && $error['type'] === E_ERROR) { + exception_handler_xml(new Exception($error['message'], 500)); + } +} -function set_exception_handler_by_format($sFormat = 'html') +function shutdown_exception_handler_json() { - if ($sFormat == 'html') { + $error = error_get_last(); + if ($error !== null && $error['type'] === E_ERROR) { + exception_handler_json(new Exception($error['message'], 500)); + } +} + + +function set_exception_handler_by_format($sFormat = null) +{ + // Multiple calls to register_shutdown_function will cause multiple callbacks + // to be executed, we only want the last executed. Thus we don't want to register + // one by default without an explicit $sFormat set. + + if (!isset($sFormat)) { + set_exception_handler('exception_handler_html'); + } elseif ($sFormat == 'html') { set_exception_handler('exception_handler_html'); + register_shutdown_function('shutdown_exception_handler_html'); } elseif ($sFormat == 'xml') { set_exception_handler('exception_handler_xml'); + register_shutdown_function('shutdown_exception_handler_xml'); } else { set_exception_handler('exception_handler_json'); + register_shutdown_function('shutdown_exception_handler_json'); } } // set a default diff --git a/sql/update-postcodes.sql b/sql/update-postcodes.sql index 1cbc8858..d59df15b 100644 --- a/sql/update-postcodes.sql +++ b/sql/update-postcodes.sql @@ -6,7 +6,7 @@ SELECT country_code, ST_Centroid(ST_Collect(ST_Centroid(geometry))) as centroid FROM placex WHERE address ? 'postcode' - AND address->'postcode' NOT SIMILAR TO '%(,|;)%' + AND address->'postcode' NOT SIMILAR TO '%(,|;|:)%' AND geometry IS NOT null GROUP BY country_code, pc; diff --git a/vagrant/Install-on-Ubuntu-18-nginx.sh b/vagrant/Install-on-Ubuntu-18-nginx.sh index 49334d44..56714989 100755 --- a/vagrant/Install-on-Ubuntu-18-nginx.sh +++ b/vagrant/Install-on-Ubuntu-18-nginx.sh @@ -97,7 +97,7 @@ server { if (!-f \$document_root\$fastcgi_script_name) { return 404; } - fastcgi_pass unix:/var/run/php7.2-fpm.sock; + fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; fastcgi_index search.php; include fastcgi.conf; }