3

I have this code to open an executable file:

exec("C:/Users/Affex/Desktop/Blockland/".$session->username."/".$session->username.".exe        ptlaaxobimwroe -dedicated");

It opens the file that I want it to open but it keeps loading the page untill the php.ini kicks in with the max execution time.

I'm trying to setup a game panel for my free hosting service, BIOHazardHosting.co.uk, We have everything else sorted but this.

3
  • We also have a login system so it does open the right file Mar 5, 2013 at 22:11
  • 1
    There's an edit button for editing the question
    – AD7six
    Mar 5, 2013 at 22:17
  • I'm not so sure you should be managing process (starting, stopping, etc) from php. That sounds like the job for SSH or cron.
    – Mr. Llama
    Mar 5, 2013 at 22:26

2 Answers 2

6

Try add putting a start in the beginning of the command:

exec("start C:/Users/Affex/Desktop/Blockland/".$session->username."/".$session->username.".exe        ptlaaxobimwroe -dedicated");

As a side note in linux you would append an & to the end of the command to achieve the same result:

exec("/Users/Affex/Desktop/Blockland/".$session->username."/".$session->username.".exe        ptlaaxobimwroe -dedicated &");
1
  • Add the /B flag if you want the process to run in the background. For example: exec("start /B C:/Users ... Mar 5, 2013 at 22:17
0

You can disable the limit in the script:

set_time_limit(0);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.