Problems starting a console application though PHP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    #1

    Problems starting a console application though PHP

    Hi to everyone!

    I have an Apache Webserver running on Win2000.
    I try to start a console application an the server though PHP, with the
    functions exec() or passthru() but it doesn't work.
    The application starts though, but doesn't work in the same way I would
    start it local on the web server (I mean though a "normal doubleclick").

    I think it depends on the type of application, cause I ca start with PHP for
    example other programms and they work fine!!

    Before I write about the specifications of my console application, I have
    this question:

    What are the technical differences between starting an application through
    PHP and starting it local on the machine???

    Thank a lot

    Maria SORANA




  • lorento

    #2
    Re: Problems starting a console application though PHP

    Check your file access permission. Allow web server to read and execute
    that file.

    --
    http://www.groupvita.com
    m.sorana@schike tanz.at wrote:
    Hi to everyone!
    >
    I have an Apache Webserver running on Win2000.
    I try to start a console application an the server though PHP, with the
    functions exec() or passthru() but it doesn't work.
    The application starts though, but doesn't work in the same way I would
    start it local on the web server (I mean though a "normal doubleclick").
    >
    I think it depends on the type of application, cause I ca start with PHP for
    example other programms and they work fine!!
    >
    Before I write about the specifications of my console application, I have
    this question:
    >
    What are the technical differences between starting an application through
    PHP and starting it local on the machine???
    >
    Thank a lot
    >
    Maria SORANA

    Comment

    • Guest's Avatar

      #3
      Re: Problems starting a console application though PHP

      Thanks!

      Sorry, I've checked the Apache ini-file, but I didn't find where to change
      my file access permissions.
      Can you give me a hint? I am not so expert in web server and PHP.

      Maria


      Comment

      • Chuck Anderson

        #4
        Re: Problems starting a console application though PHP

        m.sorana@schike tanz.at wrote:
        Hi to everyone!
        >
        I have an Apache Webserver running on Win2000.
        I try to start a console application an the server though PHP, with the
        functions exec() or passthru() but it doesn't work.
        The application starts though, but doesn't work in the same way I would
        start it local on the web server (I mean though a "normal doubleclick").
        >
        I think it depends on the type of application, cause I ca start with PHP for
        example other programms and they work fine!!
        >
        Before I write about the specifications of my console application, I have
        this question:
        >
        What are the technical differences between starting an application through
        PHP and starting it local on the machine???
        >
        Thank a lot
        >
        Maria SORANA
        To get a windows app to run in Windows XP (invoked by Php Apache
        module), I had to open the services console (services.msc), select the
        Apache service - Properties, and check Allow service to Interact with
        desktop. You might try that.

        --
        *************** **************
        Chuck Anderson • Boulder, CO

        Everyone's journey should be different,
        so that we all are enriched
        in new and endless ways
        *************** **************

        Comment

        • Csaba Gabor

          #5
          Re: Problems starting a console application though PHP

          m.sorana@schike tanz.at wrote:
          Hi to everyone!
          >
          I have an Apache Webserver running on Win2000.
          I try to start a console application an the server though PHP, with the
          functions exec() or passthru() but it doesn't work.
          The application starts though, but doesn't work in the same way I would
          start it local on the web server (I mean though a "normal doubleclick").
          >
          I think it depends on the type of application, cause I ca start with PHP for
          example other programms and they work fine!!
          >
          Before I write about the specifications of my console application, I have
          this question:
          >
          What are the technical differences between starting an application through
          PHP and starting it local on the machine???
          Maria,

          There are several differences between them, some major ones being
          environment variables, exit status, and visibility. So before I write
          about the specifics of your problem, I have this question:

          What is the specific code that isn't working, and how do you know the
          application starts, and if it starts, what does it mean for it not to
          work? Please be detailed and specific.

          Csaba Gabor from Vienna

          Comment

          • Guest's Avatar

            #6
            Re: Problems starting a console application though PHP

            Thank a lot and sorry I am so late.
            I changedthe properties in the service console as you wrote, but the
            programm still don't work properly. I add more informations in the answer to
            Csaba Gabor.


            Comment

            • Guest's Avatar

              #7
              Re: Problems starting a console application though PHP

              Thanks for the answer.

              The thing is some complicate.
              I wrote a VB6 programm with GUI which uses a COM object to send and retrieve
              datas from a remore Reuters server. I send a sql query and I get the
              response. The COM object works with events: when tha datas are retrieved
              then an event will be fired and so on.
              Well, I tried to start this programm through PHP but it did not work.
              First I thought the problem is the GUI, so I changed the programming
              language and I write a similar console application in VB.NET.

              Now, if I start the programm local on the server, it works. It sends the sql
              and after few seconds gets the response back and saves it.

              If I start it through PHP, it executes but it is not able to instantiate the
              COM object...



              Comment

              • Csaba Gabor

                #8
                Re: Problems starting a console application though PHP

                m.sorana@schike tanz.at wrote:
                Thanks for the answer.
                >
                The thing is some complicate.
                I wrote a VB6 programm with GUI which uses a COM object to send and retrieve
                datas from a remore Reuters server. I send a sql query and I get the
                response. The COM object works with events: when tha datas are retrieved
                then an event will be fired and so on.
                Well, I tried to start this programm through PHP but it did not work.
                First I thought the problem is the GUI, so I changed the programming
                language and I write a similar console application in VB.NET.
                >
                Now, if I start the programm local on the server, it works. It sends the sql
                and after few seconds gets the response back and saves it.
                >
                If I start it through PHP, it executes but it is not able to instantiate the
                COM object...
                This is like pulling teeth. Let me be more specific: "Please be
                detailed and specific." means that I want to see the relevant lines of
                code. I don't want to see all your code, but I do want to see how you
                (that is to say: the lines of code that) create the COM object and how
                you (lines of code that) hook up the event handling. And I also want
                to see the specific line that it fails on. Also, and possibly most
                importantly, exactly how do you start PHP (and if it's scheduled, the
                exact scheduling line should be provided (using password placeholders,
                of course)).

                Furthermore, the context that PHP is started under is extremely
                important. You have said "local on the server". The implication is
                that the (eventual and expected) behaviour is one where a web page
                request kicks off a server side PHP script which script is attempting
                to work with the COM object (is my inference correct? If not outline
                the scenario). There surely is a security (permissions) issue here.

                Csaba

                Comment

                Working...