Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. qt.qpa.xcb could not connect to display
Forum Updated to NodeBB v4.3 + New Features

qt.qpa.xcb could not connect to display

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
4 Posts 2 Posters 1.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pkirkham
    wrote on last edited by
    #1

    I'm using gnuplot (which apparently uses QT) on ubuntu 20.04
    gnuplot is being executed in a php module.
    If I run the php at the command line it runs fine, very quickly and generates the graphics I'm expecting. However this module is intended to be run on a webserver.
    On Apache the same module takes several minutes to run and generates these error messages in the Apache error log:

    Warning: slow font initialization
    Could not connect to existing gnuplot_qt. Starting a new one.
    qt.qpa.xcb: could not connect to display 
    qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
    This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
    
    Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
    

    Do you have any ideas on what's happening and how I can correct it?
    Best regards,
    Pete

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      The use of the xcb plugin requires an Xorg server to be active which you likely do not have on your server. One way to make it work would be to use the offscreen backend.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      P 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi and welcome to devnet,

        The use of the xcb plugin requires an Xorg server to be active which you likely do not have on your server. One way to make it work would be to use the offscreen backend.

        P Offline
        P Offline
        pkirkham
        wrote on last edited by
        #3

        @SGaist Hi thanks for this proposal but how do I do it?
        Best regards,
        Pete

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Either by passing the -platform argument to your application or using the QT_QPA_PLATFORM environment variable.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved