Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QProcess & Apache
Forum Updated to NodeBB v4.3 + New Features

QProcess & Apache

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.1k 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.
  • X Offline
    X Offline
    xaoseric
    wrote on last edited by
    #1

    When I try to start httpd.exe with QProcess, I get an error. Is there a way to start httpd.exe with QProcess?

    I'm currently using:

    [code]
    QProcess *httpd;
    QString program = "./apache/bin/httpd.exe";
    httpd->start(program);
    [/code]

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      What kind of error are you getting? I suspect you need to run this program using QFrocess::startDetached(). But it is hard to tell without more details.

      BTW: you are using relative paths. This approach will fail if your application is started from a different directory. It is more secure to use this:
      @
      QString program(QCoreApplication::instance()->applicationDirPath() + "/apache/bin/httpd.exe");
      @

      (Z(:^

      1 Reply Last reply
      0
      • X Offline
        X Offline
        xaoseric
        wrote on last edited by
        #3

        [quote author="sierdzio" date="1391578111"]What kind of error are you getting? I suspect you need to run this program using QFrocess::startDetached(). But it is hard to tell without more details.
        [/quote]

        I'll take a screen shot later and upload it. The message say something along the lines of windows wouldn't allow some process to start, etc. Using startDetached, would that allow httpd.exe to run seperatly? When I use execute, apache starts, but the qt program won't allow you to drag it, or interact with it. I'm assuming, I would need to do the same thing with mysql as well? Yes, I know there's other programs like XAMPP, but I'm programming WinLAMP to have features that XAMPP doesn't.

        Edit: looking at the docs, I'm guessing what happened was apache tried to start, but failed because it wasn't its own separate process. I'll try using startDetached, and update based on results.

        http://qt-project.org/doc/qt-5.0/qtcore/qprocess.html#startDetached

        1 Reply Last reply
        0

        • Login

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