{"id":13856585,"url":"https://github.com/maptiler/tileserver-php","last_synced_at":"2026-03-14T06:39:35.027Z","repository":{"id":3986993,"uuid":"5082973","full_name":"maptiler/tileserver-php","owner":"maptiler","description":"MBTiles and MapTiler folder hosting with TileJSON, OGC WMTS, UTFGrid interaction and web interface. QGIS \u0026 ESRI ArcGIS compatible. Runs on any Apache+PHP webhosting. MapBox Studio Vector Tiles hosting.","archived":false,"fork":false,"pushed_at":"2022-07-30T00:03:52.000Z","size":1510,"stargazers_count":554,"open_issues_count":45,"forks_count":163,"subscribers_count":49,"default_branch":"master","last_synced_at":"2024-05-21T01:05:47.013Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://tileserver.maptiler.com/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maptiler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-07-17T14:28:34.000Z","updated_at":"2024-04-19T10:41:45.000Z","dependencies_parsed_at":"2022-07-16T23:31:11.886Z","dependency_job_id":null,"html_url":"https://github.com/maptiler/tileserver-php","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptiler%2Ftileserver-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptiler%2Ftileserver-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptiler%2Ftileserver-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptiler%2Ftileserver-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maptiler","download_url":"https://codeload.github.com/maptiler/tileserver-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptiler%2Ftileserver-php/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259172987,"owners_count":22816560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-05T03:01:05.264Z","updated_at":"2025-12-17T23:19:14.260Z","avatar_url":"https://github.com/maptiler.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"TileServer PHP: MapTiler and MBTiles maps via WMTS\n==================================================\n\n[![Build Status](https://travis-ci.org/klokantech/tileserver-php.svg)](https://travis-ci.org/klokantech/tileserver-php)\n[![Docker Hub](https://img.shields.io/badge/docker-hub-blue.svg)](https://hub.docker.com/r/klokantech/tileserver-php/)\n\nThis server distributes maps to desktop, web, and mobile applications from a standard Apache+PHP web hosting.\n\nIt is a free and open-source project implementing the OGC WMTS standard for pre-rendered map tiles made with any [map tiling software](https://www.maptiler.com/desktop/) like MapTiler Desktop, GDAL2Tiles, or any other MBTiles file.\n\nIt is the easiest and cheapest way how to serve zoomable maps in a standardized way - practically from any ordinary web hosting.\n\nIt is easy to install - copy the project files to a PHP-enabled directory along with your map data.\n\nIt comes with an online interface showing the list of the maps and step-by-step guides for online mapping libraries (Google Maps API, Leaflet, OpenLayers, OL3, MapLibre GL JS, ArcGIS JS) and various desktop GIS software:\n\n![tileserver-screenshot](https://f.cloud.github.com/assets/59284/1041807/a040160c-0fdb-11e3-8941-ab367b2a648d.png)\n\nThis project is developed in PHP, not because it is the best language for the development of web applications, but because it maximally simplifies the deployment on a large number of web hostings, including various free web hostings providers.\n\nTiles are served directly by Apache with mod_rewrite rules as static files and therefore are very fast and with correct HTTP caching headers. Only XML metadata is delivered via PHP. MBTiles are served via PHP and are therefore slower unless they are unpacked with mbutil.\n\n[MapTiler](http://www.maptiler.com/) can render GeoTIFF, ECW, MrSID, GeoPDF into compatible map tiles. JPEG, PNG, GIF, and TIFF with scanned maps or images without geolocation can be turned into standard map layers with the visual georeferencing functionality (http://youtu.be/eJxdCe9CNYg).\n\n[![MapTiler - mapping tiles](https://cloud.githubusercontent.com/assets/59284/3037911/583d7810-e0c6-11e3-877c-6a7747b80dd3.jpg)](http://www.maptiler.com/)\n\nRequirements:\n-------------\n\n- Apache webserver (with mod_rewrite / .htaccess supported)\n- PHP 5.6+ with SQLite module (php5-sqlite)\n\n(or another webserver implementing mod_rewrite rules and PHP)\n\nInstallation:\n-------------\n\nDownload the project files as a [zip archive](https://github.com/klokantech/tileserver-php/archive/master.zip) or source code from GitHub and unpack it into a web-hosting of your choice.\n\nIf you access the web address relevant to the installation directory, the TileServer.php Server should display you a welcome message and further instructions.\n\nThen you can upload to the web hosting your mapping data - a directory with tiles rendered with [MapTiler](http://www.maptiler.com/).\n\nTiles produced by open-source GDAL2Tiles or MapTiler Desktop and tiles in .mbtiles format can be easily converted to the required structure (XYZ with top-left origin and metadata.json file). The open-source utility [mbutil](https://github.com/mapbox/mbutil) produces exactly the required format.\n\nDirect reading of .mbtiles files is supported but with decreased performance compared to the static files in a directory. The advantage is easier data management, especially upload over FTP or similar protocols.\n\nSupported protocols:\n--------------------\n\n- OpenGIS WMTS 1.0.0\n\n  The Open Geospatial Consortium (OGC) Web Map Tile Service (WMTS)\n  Both KVP and RESTful version 1.0.0:\n  http://www.opengeospatial.org/standards/wmts/\n\n  Target is maximal compliance to the standard.\n\n  Exposed at http://[...]/wmts\n\n- OSGeo TMS 1.0.0\n\n  The OSGeo Tile Maps Service, but with inverted y-coordinates:\n  http://wiki.osgeo.org/wiki/Tile_Map_Service_Specification\n  This means request compatible with OpenStreetMap tile servers.\n\n  Target is \"InvertedTMS\" implementation used by the ArcBruTile client\n  which is available from http://arcbrutile.codeplex.com/ and uses\n  flipped y-axis.\n\n  Exposed at http://[...]/tms\n\n- TileJSON\n\n  Metadata about the individual maps in a ready to use form for web\n  clients following the standard http://mapbox.com/developers/tilejson/\n  and with support for JSONP access.\n\n  Exposed at http://[...]/layer.json or .jsonp\n\n- Direct access with XYZ tile requests (to existing tiles in a directory\n  or to .mbtiles)\n\n  Compatible with Google Maps API / Bing SDK / OpenStreetMap clients.\n\n  Exposed at http://[...]/layer/z/x/y.ext\n\n- MapBox UTFgrid request (for existing tiles in .mbtiles with UTFgrid support). Callback is supported\n\n  Example https://www.mapbox.com/demo/visiblemap/\n  Specification https://github.com/mapbox/utfgrid-spec\n\n  Exposed at http://[...]/layer/z/x/y.grid.json\n\n- MapBox Vector Tiles (for MBTiles generated by [MapBox Studio Classic](https://www.mapbox.com/mapbox-studio-classic/) or by [OSM2VectorTiles](http://osm2vectortiles.org/) project).\n\n  Example http://osm2vectortiles.tileserver.com/\n  TileJSON can be used in MapBox Studio Classic, MapBox SDKs/APIs, OpenLayers, etc.\n\n  Exposed at http://[...]/layer/z/x/y.pbf\n\n- Retina / HighDPI routing with 512 tiles\nUse @2x suffix in url for JSONs and tiles. For example http://tileserver.maptiler.com/grandcanyon@2x.json  \n\nTo use the OGC WMTS standard, point your client (desktop or web) to the URL of 'directory' where you installed tileserver.php project with suffix \"wmts\".\nFor example: http://www.example.com/directory/wmts\n\nIf you have installed the project into a root directory of a domain, then the address is: http://www.example.com/wmts\n\nThe supported WMTS requests includes:\n\nGetCapabilities RESTful/KVP:\n\n   http://[...]/1.0.0/WMTSCapabilities.xml\n   http://[...]?service=wmts\u0026request=getcapabilities\u0026version=1.0.0\n\nGetTile RESTful/KVP:\n\n   http://[...]/layer/[ANYTHING-OPTIONAL][z]/[x]/[y].[ext]\n   http://[...]?service=wmts\u0026request=getTile\u0026layer=[layer]\u0026tilematrix=[z]\u0026tilerow=[y]\u0026tilecol=[y]\u0026format=[ext]\n\nOther example requests are mentioned in the .htaccess.\n\nTileServer-PHP supports all coordinates systems. You have to define it with tilejson with specification on https://github.com/klokantech/tilejson-spec/tree/custom-projection/2.2.0\nOr use MapTiler to produce datasets with this specification.\n\nPerformance from the web clients\n--------------------------------\n\nIt is highly recommended to map several domain names to the service, such as:\n\nhttp://a.example.com/, http://b.example.com/, http://c.example.com/.\n\nThis can be done with DNS CNAME records pointing to your hosting. The reason for this is that traditionally browsers will not send more than two simultaneous HTTP requests to the same domain - with multiple domains for the same server, you can better saturate the network and receive the maps faster.\n\nPerformance\n-----------\n\nIn case the data are available in the form of a directory with XYZ tiles, then the Apache webserver is serving these files directly as WMTS RESTful or KVP.\n\nThis means performance is excellent, maps are delivered very fast, and a large number of concurrent visitors can be handled even with quite low-end hardware or cheap/free web hosting providers.\n\nMod_rewrite rules are utilized to ensure the HTTP requests defined in the OCG WMTS standard are served, and Apache preserves standard caching headers \u0026 eTag.\n\nThe performance should be significantly better than any other tile caching project (such as TileCache.org or GeoWebCache).\n\nPerformance graph for \"apache static\" comparing other tile caching projects is available online at http://code.google.com/p/mod-geocache/wiki/PreliminaryBenchmark\n\nLimits of actual implementation\n-------------------------------\n\nWith intention, at this moment, the project supports only:\n- We enforce and require XYZ (top-left origin) tiling schema (even for TMS).\n\nPassword protection\n-------------------\n\nHTTP Simple Authentication can be easily added to the server.\nEdit the .htaccess and add these lines:\n\n    AuthUserFile /full/path/to/.htpasswd\n    AuthType Basic\n    AuthName \"Secure WMTS\"\n    Require valid-user\n\nCreate a file called .htpasswd with user:password format.\nYou can use a command-line utility:\n\n$ htpasswd -c .htpasswd [your-user-login]\n\nOr an online service:\n\nhttp://www.htaccesstools.com/htpasswd-generator/\n\nHTTPS / SSL support\n-------------------\n\nTileServer.php can run without any problems over HTTPS, if required.\n\nMicrosoft Windows web-hosting\n-----------------------------\n\nThe TileServer.php should run on Windows-powered webservers with Apache installation if PHP 5.2+ and mod_rewrite are available.\n\nWith the IIS webserver hosting, you may need PHP and IIRF module (http://iirf.codeplex.com/) and alter appropriately the rewrite rules.\n\nCredits / Contributors\n----------------------\n\nProject developed initially by Klokan Technologies GmbH, Switzerland, in cooperation with National Oceanic and Atmospheric Administration - NOAA, USA.\n\n- Petr Pridal - Klokan Technologies GmbH \u003cpetr.pridal@maptiler.com\u003e\n- Jason Woolard - NOAA \u003cjason.woolard@noaa.gov\u003e\n- Jon Sellars - NOAA \u003cjon.sellars@noaa.gov\u003e\n- Dalibor Janak - Klokan Technologies GmbH \u003cdalibor.janak@maptiler.com\u003e\n\nTested WMTS/TMS clients\n-----------------------\n\n- QuantumGIS Desktop 1.9+ - open with Layer-\u003eAdd WMS layer\n  http://www.qgis.org/\n- ESRI ArcGIS Desktop 10.1+ - native WMTS implementation supported\n  http://www.esri.com/software/arcgis/arcgis-for-desktop\n- ESRI ArcGIS Online - loading via WMTS protocol\n  http://www.arcgis.com/\n- ArcBruTiles plugin for ArcGIS 9.3+ - via TMS endpoint\n  http://arcbrutile.codeplex.com/\n- OpenLayers WMTS Layer - including parsing GetCapabilities\n  http://www.openlayers.org/\n- GAIA - native WMTS (issues with 3857 to be fixed)\n  http://www.thecarbonproject.com/gaia.php\n- MapBox.js - the loading of maps via TileJSON, interaction layer supported\n  https://www.mapbox.com/mapbox.js\n  \nAlternative\n-----------\n\nIf you need [map server with commercial support](https://www.maptiler.com/server/), explore the possibilities provided by the MapTiler Server.\n\nBSD License\n-----------\n\nCopyright (C) 2020 MapTiler AG (https://www.maptiler.com/)\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaptiler%2Ftileserver-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaptiler%2Ftileserver-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaptiler%2Ftileserver-php/lists"}