3liz / lizmap-web-client

Transfer a QGIS project on a server, Lizmap is providing the web interface to browse it
https://www.lizmap.com
Mozilla Public License 2.0
257 stars 143 forks source link

Clear docs about installation on Windows #1327

Open gioman opened 5 years ago

gioman commented 5 years ago

Dear all, is anyone able to point me to a clear document/path about an installation of LM (QGIS Server 3, Apache, PHP, LM 3.3) on Windows?

So far this is what I tried:

1) in the old days (QGIS Server 2 and LM2) it was fairly easy to install the stack using the OSGeo4W (32 bit) installer: Apache, PHP (5), QGIS Server 2.18 and everything was working out of the box. This still works (by installing the packages that are in the "obsolete" section), also together with LM2, with the only limitation that printing/GetPrint does not work (at the time it was an issue that caused a lot of discussions, as with 2.14 worked as expected and it was caused by a dependency (fake xserver) that could only be satisfied on Linux).

But of course this is old stuff, so I would prefer a way to use QGIS Server 3 and LM 3.3

2) The QGIS Docs about installing QGIS Server 3 on Windows are clear

https://docs.qgis.org/3.4/en/docs/user_manual/working_with_ogc/server/getting_started.html#installation-on-windows

but the problem that they result in a non working installation. The type of error when testing QGIS Server is "end of script output before headers". This is the same error one gets under Linux if does not install the fcgi apache module which is a QGIS Server 3 dependency (as far as I understand). It does not seems that the XAMPP installer install the fcgi apache extension, so the error.

So this is a dead end (and the official QGIS docs useless/misleading)

3) One could still try use the OSGeo4W 32 bit installer (because the 64 bit one does not include Apache) and install "modern" packages (I used the quotes because PHP is till version 5). This mostly works, but not completely as it falls short when installing LM 3. Installations of QGIS Desktop/Server, PHP, Apache, mod-fcgi all go well and one gets a working installation of QGIS Server 3, but when following the instructions to install/enable LM 3 then it fails at

C:\OSGeo4W\apache\htdocs\webgis2>php lizmap/install/installer.php

Warning: require_once(__DIR__/../application.init.php): failed to open stream: N
o such file or directory in C:\OSGeo4W\apache\htdocs\webgis2\lizmap\install\inst
aller.php on line 10

Fatal error: require_once(): Failed opening required '__DIR__/../application.ini
t.php' (include_path='.;C:\OSGeo4W\Apache\php\PEAR') in C:\OSGeo4W\apache\htdocs
\webgis2\lizmap\install\installer.php on line 10

LM2 does not seems to work with this setup.

4) As lat resort I have tried following the official docs

https://docs.lizmap.com/current/en/install/windows.html

which are very similar to

https://opengislab.com/blog/2018/7/7/updated-installing-apache-qgis-server-and-lizmap-on-windows-os

and this time the process fails really at the finish line. Lizmap does not work because after all QGIS Server is failing

17:01:55 INFO Server[2860]: ******************** New request ***************
17:01:55 INFO Server[2860]: SERVER_NAMElocalhost
17:01:55 INFO Server[2860]: REQUEST_URI/qgis/qgis_mapserv.fcgi.exe?map=C:/Users/qgis/Desktop/test/test_proj.qgs&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities
17:01:55 INFO Server[2860]: REMOTE_ADDR::1
17:01:55 INFO Server[2860]: HTTP_USER_AGENTMozilla/5.0 (Windows NT 6.1; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0
17:01:55 INFO Server[2860]: MAP:C:/Users/qgis/Desktop/test/test_proj.qgs
17:01:55 INFO Server[2860]: REQUEST:GetCapabilities
17:01:55 INFO Server[2860]: SERVICE:WMS
17:01:55 INFO Server[2860]: VERSION:1.3.0
17:01:55 WARNING [2860]: Invalid data provider ogr
17:01:55 CRITICAL Server[2860]: Layer(s) test_46969f5c_959b_4867_b820_10ae141699ec not valid
17:01:55 INFO Server[2860]: Request finished in 31 ms

any hint would be much appreciated.

gioman commented 5 years ago

I redone the steps from

https://docs.lizmap.com/current/en/install/windows.html

which are very similar to

https://opengislab.com/blog/2018/7/7/updated-installing-apache-qgis-server-and-lizmap-on-windows-os

and confirm that it only works if installing qgis server 2.18 from osgeo4w (but then it has its own issues), while with qgis server 3.4 it does not work (qgis server problems, not LM).

gioman commented 5 years ago

It seems there is a magic recipe... I will try document it.