Allow url fopen

From MapbenderWiki

Jump to: navigation, search

Contents

English

The php.ini file setting allow_url_fopen = OFF is the first thing to check when troubleshooting Mapbender Capabilities upload! Read carefully through this section to understand what exactly is happening!

allow_url_fopen has to be turned ON for PHP to be able to download any OGC Capabilities document.

Description

Whenever a new Capabilities document is uploaded Mapbender requests the URL as a file - hence the F in <allow_urlfopen> standing for File-open. When the OGC Capabilities document has been downloaded by the PHP script it is automatically analyzed and stored in the appropriate tables of the administration database. If this does not work you receive an SQL error and rollback message.

This access is one of the very few places that a Mapbender PHP script will try to open a URL outside its own server.

Most PHP applications will usually not have to access an external URL as a file. Therfore most system administrators will usually set this parameter to OFF which in most cases is OK.

If your system administrator will not change this setting due to paranoid security settings this is perfectly OK, do not get angry with her. As a workaround you can download the OGC Capabilities document and pass it to your sysadmin so that she can put it directly onto the file system of the Mapbender server. Then PHP will be able to open it anyway.

Notice

If you cannot set allow_url_fopen = on you will not be able to add services dynamically (AddWMS, Add WMS from list, Add WMS from filtered list) because Mapbender always requests these Capabilities directly from the service and analyzes them on the fly! This problem is currently being addressed and will be resolved in one of the next versions by uploading the Capabilities once and then work from this copy.

Try to convince your administrator that the Mapbender box might run on a separate server that is allowed to <allow_url_fopen> to anywhere in the internet.

Beware

Actually seeing and downloading the Capabilities document with your own browser does definitely not prove that the PHP script on the server can also do that! So always check back whether your server engine can access the Capabilities documents appropriately.

Keywords:

  • Load Capabilities
  • Update Capabilities

Deutsch

Ein falscher allow_url_fopen = OFF Wert in den Einstellungen der Datei php.ini kann am meisten Schwierigkeiten hervor rufen, wenn Sie Mapbender installieren! Lesen Sie dieses Kapitel sorgfältig, um genau zu verstehen was passiert!

Der Parameter allow_url_fopen muss auf on gestellt werden, damit PHP in der Lage ist jedes OGC Capabilities-Dokument herunterzuladen.

Beschreibung

Jedes mal wenn ein neues Capabilities-Dokument hochgeladen wird, fordert Mapbender die URL als Datei an - deshalb steht das F in <allow_url_f_open> für Datei öffnen (file-open). Wenn das Capabilities-Dokument vom PHP-Skript runtergeladen wurde, wird es automatisch analysiert und in den entsprechenden Tabellen der Administrations Datenbank gespeichert. Wenn es nicht funktioniert erhalten Sie einen SQL Error und eine Meldung über die Zurücksetzung des Befehls.

Dieser Zugang ist einer der wenigen Stellen an der ein Mapbender PHP-Skript versuchen wird eine URL außerhalb des eigenen Servers zu öffnen.

Die meisten PHP Applikationen benötigen normalerweise keinen Dateizugriff auf externe Dateien. Deshalb setzen normalerweise die meisten System-Administratoren diesen Parameter auf OFF, was in den meisten Fällen auch ok ist.

Wenn Ihr System-Administrator diese Einstellung nicht ändern will, wegen paranoider Sicherheitseinstellungen, ist das auch sehr in Ordnung, seien Sie ihm/ihr nicht böse. Als Aushilfslösung können Sie das OGC Capabilities-Dokument auch herunterladen und auf diese Weise durch Ihre System-Administration bekommen und direkt in das Datei-System Ihres Mapbenders laden. Dann kann es PHP auf jeden Fall öffnen.

Hinweis

Wenn Sie den Parameter <allow_url_fopen = on> nicht anstellen können, werden Sie nicht in der Lage sein dynamisch Dienste hinzuzuladen (AddWMS, Add WMS from list, Add WMS from filtered list), da Mapbender diese Capabilities-Dokumente immer direkt von dem Dienst anfordert und sie während der Übertragung analysiert. In einer der nächsten Versionen wird das behoben, indem immer auf die lokale Kopie des Capabilities Dokumentes verwiesen wird. Dann muss es nur noch einmal hochgeladen werden.

Versuchen Sie Ihren Administrator zu überzeugen, dass Mapbender auf einem eigenen Server läuft, dem es mit dem Parameter <allow_url_fopen> erlaubt ist überall im Internet URL zu öffnen. Alterntiv legen Sie Kopien der XML Dokumente in Reichweite Ihres Servers an. Beachten Sie dabei, dass jede Änderung auf dem Server auch in diesen Cache-Dokumenten berücksichtigt werden muss.

Zur Beachtung

Dass Sie mit Ihrem eigenen Browser das Capabilities-Dokument sehen und runterladen können, beweist nicht, dass das PHP-Skript auf dem Server das auch kann! Also kontrollieren Sie immer, ob Ihr Server Zugang zu den Capabilities-Dokumenten hat.

Ein Beitrag in der Userliste sagt aus, dass beim Drucken (mod_printPDF_pdf.php) der GetMap nicht vom Client (Browser) sondern vom Mapbender-Server ausgeführt wird. Auch hierzu ist dieser Eintrag auf 'on' zu setzen.

Stichworte

  • Hochgeladene aktualisieren
  • Capabilities hochladen
Personal tools