Skip to content

Commit 1d7d51c

Browse files
committed
[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.
1 parent 8873464 commit 1d7d51c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/core/qgsapplication.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,12 @@ void QgsApplication::init( QString profileFolder )
220220
setPrefixPath( myPrefix, true );
221221
#else
222222
QDir myDir( applicationDirPath() );
223-
myDir.cdUp();
223+
// Fix for server wich is one level deeper in /usr/lib/cgi-bin
224+
if ( applicationDirPath().contains( QStringLiteral( "cgi-bin" ) ) )
225+
{
226+
myDir.cdUp();
227+
}
228+
myDir.cdUp(); // Go from /usr/bin or /usr/lib (for server) to /usr
224229
QString myPrefix = myDir.absolutePath();
225230
setPrefixPath( myPrefix, true );
226231
#endif

0 commit comments

Comments
 (0)