Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qgis server installation and configuration - End of script output before headers: qgis_mapserv.fcgi.exe #24698

Closed
qgib opened this issue Jul 6, 2017 · 5 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Server Related to QGIS server

Comments

@qgib
Copy link
Contributor

qgib commented Jul 6, 2017

Author Name: atilio françois (atilio françois)
Original Redmine Issue: 16799
Affected QGIS version: 2.14.11
Redmine category:qgis_server


I installed (on Windows 10 but also on windows 7 with exactly the same result) Apache/PHP with Stackbuilder,and then QGis Server 64bits with osgeo4w-setup-x86_64.exe

After install I modified apache httpd.conf following http://level2.si/2015/12/qgis-server-on-windows-10/ instructions:
ScriptAlias /cgi-bin/ "c:/OSGeo4W64/apps/qgis-ltr/bin/"

<Directory "c:\OSGeo4W64\apps\qgis-ltr\bin">
SetHandler cgi-script
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
Require all granted

AddHandler cgi-script .cgi .pl .exe

AcceptFilter http none
AcceptFilter https none

SetEnv GDAL_DATA "C:\OSGeo4W64\share\gdal"
SetEnv QGIS_AUTH_DB_DIR_PATH "C:\OSGeo4W64\apps\qgis-ltr\resources"
SetEnv PYTHONHOME "C:\OSGeo4W64\apps\Python27"
SetEnv PATH "C:\OSGeo4W64\bin;C:\OSGeo4W64\apps\qgis-ltr\bin;C:\OSGeo4W64\apps\grass\grass-@grassversion@\bin;C:\OSGeo4W64\apps\grass\grass-@grassversion@\lib;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem”
SetEnv QGIS_PREFIX_PATH "C:\OSGeo4W64\apps\qgis-ltr"
SetEnv QT_PLUGIN_PATH "C:\OSGeo4W64\apps\qgis-ltr\qtplugins;C:\OSGeo4W64\apps\qt4\plugins"

I restart apache service and try to test test the install with the url

http://localhost:8081/cgi-bin/qgis_mapserv.fcgi.exe?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities

I get the next message in my browser:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at admin@example.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

In the apache log I get the next line:

Wed Jul 05 19:11:52.792509 2017] [cgi:error] [pid 3276:tid 804] [client 127.0.0.1:27613] End of script output before headers: qgis_mapserv.fcgi.exe

I tried a few things founds in the web (copying dll and .py to other directories) but the result is always the same error message

@qgib
Copy link
Contributor Author

qgib commented Jul 20, 2017

Author Name: Giovanni Manghi (@gioman)


On Windows it not obvious, but you must install also QGIS Desktop (same version of the server of course), did you? Another issue I have seen in the past is that despite being possible to install with osgeo4w multiple qgis server versions (say LTR and 2.18) you really must have just 1 installed to not get errors. Please check and report back.


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Jul 20, 2017

Author Name: Giovanni Manghi (@gioman)


also installing the necessary components from osgeo4w (which is the official way) it works as expected:

http://localhost/qgis/qgis_mapserv.fcgi.exe?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities

@<WMS_Capabilities version="1.3.0" xsi:schemaLocation="http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/sld_capabilities.xsd http://www.qgis.org/wms http://localhost/qgis/qgis_mapserv.fcgi.exe?SERVICE=WMS&REQUEST=GetSchemaExtension">WMS

<Title>QGIS mapserver</Title>A WMS service with QGIS mapserverQGIS mapserver Marco HugentoblerSourcepole AGpostalWeberstrasse 5ZürichZH8004SWITZERLANDmarco.hugentobler@sourcepole.ch nonenone99text/xmlimage/jpegimage/pngimage/png; mode=16bitimage/png; mode=8bitimage/png; mode=1bitapplication/dxftext/plaintext/htmltext/xmlapplication/vnd.ogc.gmlapplication/vnd.ogc.gml/3.1.1image/jpegimage/pngtext/xmltext/xmlXMLwfslayer@

@qgib
Copy link
Contributor Author

qgib commented Sep 25, 2017

Author Name: Giovanni Manghi (@gioman)


Closing for lack of feedback, please reopen if necessary.


  • resolution was changed from to not reproducable
  • status_id was changed from Feedback to Closed

@qgib qgib closed this as completed Sep 25, 2017
@qgib
Copy link
Contributor Author

qgib commented Jan 25, 2018

Author Name: Nino Formica (Nino Formica)


I have the same problem with QGIS server 2.18.16 installed on Ubuntu 16. When I call:
http://localhost/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities
I get (on the browser):500 internal server error

This is Apache 2.4 error.log:
Warning 1: Unable to find driver ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver JP2ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver JP2ECW to unload from GDAL_SKIP environment variable.
[Thu Jan 25 21:35:31.743355 2018] [fcgid:warn] [pid 3376:tid 139896667043584] [client 127.0.0.1:49866] mod_fcgid: read data timeout in 40 seconds
[Thu Jan 25 21:35:31.743490 2018] [core:error] [pid 3376:tid 139896667043584] [client 127.0.0.1:49866] End of script output before headers: qgis_mapserv.fcgi

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Server Related to QGIS server labels May 25, 2019
@jgrocha
Copy link
Member

jgrocha commented Jul 3, 2019

Just for the record, I've got the same error on Apache log:

[Wed Jul 03 17:19:42.033792 2019] [fcgid:warn] [pid 18495] (104)Connection reset by peer: [client 188.82.64.125:8759] mod_fcgid: error reading data from FastCGI server
[Wed Jul 03 17:19:42.033856 2019] [core:error] [pid 18495] [client 188.82.64.125:8759] End of script output before headers: qgis_mapserv.fcgi

The problem was solved as soon as I've installed the X server (the xvfb).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Server Related to QGIS server
Projects
None yet
Development

No branches or pull requests

2 participants