exec() launched from Linux for Win commands

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paolo Scolamacchia

    exec() launched from Linux for Win commands

    Hi everybody, this is my environment : Apache is installed on a Linux server
    (RedHat9A) and
    I launch the browser on a PC running WindowsXP to execute php scripts on the
    Linux server.
    I would run Win executables from this Linux-based Apache server.

    Actually if I use exec() command running Linux commands, something like :

    $command="mv /store1/www/file1.txt /store1/www/file2.txt";
    exec($command, $ar_output, $res_command);
    echo "res_command=". $res_command;

    it returns : res_command=0 and all works fine.

    The problem arises when I try to use the same exec command for running
    applications in the PC, e.g.:

    $command="C:\\P rograms\\WINEDI T.EXE";
    exec($command, $ar_output, $res_command);
    echo "res_command=". $res_command;

    Now it returns : res_command=127 and it does not work ( = it does not start
    WINEDIT.EXE)

    What is missing or wrong in my job?

    Any suggestion or hint will be very useful, thanks in advance for your help.
    Regards,
    Paolo




  • brian

    #2
    Re: exec() launched from Linux for Win commands

    p.scolamacchia-STOP-S-P-A-M-NOW@quantel.it idiotically stated:[color=blue]
    > Now it returns : res_command=127 and it does not work ( = it does
    > not start WINEDIT.EXE)
    >
    > What is missing or wrong in my job?
    >
    > Any suggestion or hint will be very useful, thanks in advance for
    > your help. Regards,
    > Paolo[/color]

    PHP is server side, it can't do anything at all on the (client) PC. If it
    could it would be the biggest security hole ever made.

    So what this basically means is that you're trying to run a windows command
    on a linux box, which obviously isn't going to work.

    --
    brian ... brian@cc
    The owner of this domain has not yet uploaded their website.



    Comment

    • Matthias Esken

      #3
      Re: exec() launched from Linux for Win commands

      "Paolo Scolamacchia" <p.scolamacch ia-STOP-S-P-A-M-NOW@quantel.it>
      schrieb:
      [color=blue]
      > Hi everybody, this is my environment : Apache is installed on a Linux server
      > (RedHat9A) and
      > I launch the browser on a PC running WindowsXP to execute php scripts on the
      > Linux server.
      > I would run Win executables from this Linux-based Apache server.[/color]

      So you have to download the Windows executable from your server and
      start it manually after that.
      [color=blue]
      > Actually if I use exec() command [...][/color]

      exec() will always try to execute the given program on the server. You
      can't start a program on the client with a PHP script running on the
      server.

      Regards,
      Matthias

      Comment

      • Alvaro G Vicario

        #4
        Re: exec() launched from Linux for Win commands

        *** Paolo Scolamacchia wrote/escribió (Thu, 20 Nov 2003 18:20:19 +0100):[color=blue]
        > What is missing or wrong in my job?[/color]

        Windows binaries do not run under Linux, the same as MacOS programs can't
        be run in Windows. Do you think people would stick to Windows so massively
        if they could easily run Adobe Photoshop or Tomb Raider in any OS? ;-)

        --
        --
        -- Álvaro G. Vicario - Burgos, Spain
        --

        Comment

        Working...