1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Executing a external file from PHP

Discussion in 'PHP' started by Bhullarz, Feb 24, 2009.

  1. Bhullarz

    Bhullarz New Member

    Joined:
    Nov 15, 2006
    Messages:
    253
    Likes Received:
    13
    Trophy Points:
    0
    Occupation:
    System Manager
    Home Page:
    Hi ! I am trying to execute an external file i.e abc.exe from php but it is not working.
    I have used the following code:
    Code:
    <?php
    	exec("executable1.exe -o arg1 arg2");
    	shell_exec("executable1.exe -o arg1 arg2");
    	system("executable1.exe -o arg1 arg2");
    ?>
    
    None of the commands seem to be working. What's wrong in the code?
     
  2. Bhullarz

    Bhullarz New Member

    Joined:
    Nov 15, 2006
    Messages:
    253
    Likes Received:
    13
    Trophy Points:
    0
    Occupation:
    System Manager
    Home Page:
    No one replied yet. But I have solved this problem. so no worries
     
  3. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,293
    Likes Received:
    365
    Trophy Points:
    83
    Why dont you share it here so if anyone searching can find it easily
     
  4. Bhullarz

    Bhullarz New Member

    Joined:
    Nov 15, 2006
    Messages:
    253
    Likes Received:
    13
    Trophy Points:
    0
    Occupation:
    System Manager
    Home Page:
    It may sound funny to all. I developed a software in Windows and transferred to server which is Linux Server. This was the reason EXE files were not working there.
     

Share This Page