From 1d7d51c8e193638f99dd6437db2791a0670d3393 Mon Sep 17 00:00:00 2001 From: Alessandro Pasotti Date: Thu, 1 Mar 2018 13:12:55 +0100 Subject: [PATCH 1/2] [bugfix][server] Fix prefix path for server Fixes #18230 - service configuration error (service unknown or unsupported) I though about placing the fix into the server code, but I believe that it's much more cleaner here: otherwise we'd need to adjust all other paths *after* they were uncorrectly set by the application init() code. --- src/core/qgsapplication.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/qgsapplication.cpp b/src/core/qgsapplication.cpp index 358c2112d59..46eed284fac 100644 --- a/src/core/qgsapplication.cpp +++ b/src/core/qgsapplication.cpp @@ -220,7 +220,12 @@ void QgsApplication::init( QString profileFolder ) setPrefixPath( myPrefix, true ); #else QDir myDir( applicationDirPath() ); - myDir.cdUp(); + // Fix for server wich is one level deeper in /usr/lib/cgi-bin + if ( applicationDirPath().contains( QStringLiteral( "cgi-bin" ) ) ) + { + myDir.cdUp(); + } + myDir.cdUp(); // Go from /usr/bin or /usr/lib (for server) to /usr QString myPrefix = myDir.absolutePath(); setPrefixPath( myPrefix, true ); #endif From 0050eb5936d3e33e6ed4542c38699a07df1c5483 Mon Sep 17 00:00:00 2001 From: Alessandro Pasotti Date: Thu, 1 Mar 2018 13:52:07 +0100 Subject: [PATCH 2/2] Spelling --- src/core/qgsapplication.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/qgsapplication.cpp b/src/core/qgsapplication.cpp index 46eed284fac..e311824daa8 100644 --- a/src/core/qgsapplication.cpp +++ b/src/core/qgsapplication.cpp @@ -220,7 +220,7 @@ void QgsApplication::init( QString profileFolder ) setPrefixPath( myPrefix, true ); #else QDir myDir( applicationDirPath() ); - // Fix for server wich is one level deeper in /usr/lib/cgi-bin + // Fix for server which is one level deeper in /usr/lib/cgi-bin if ( applicationDirPath().contains( QStringLiteral( "cgi-bin" ) ) ) { myDir.cdUp();