Forum Moderators: coopster
I'm trying to write a simple script which allows users to hit a link which opens a page. And by doing this, they restart a program that I am currently hosting.
I downloaded and installed pskill.exe which allows you to terminate a running proccess and using it in system(), but I can't seem to get system() to start a program.
Maybe using exec() would work?
Any help is appreciated.
Thanks :).
try exec or passthru depending on what type of output you need. From the sounds of it exec would be appropriate.
exec() executes the given command, however it does not output anything. It simply returns the last line from the result of the command. If you need to execute a command and have all the data from the command passed directly back without any interference, use the passthru() function.
We had some issues with memory_limit because it seems it takes into account the size of everything being exec'ed.
one thing to note about system as well
Note: If you start a program using this function and want to leave it running in the background, you have to make sure that the output of that program is redirected to a file or some other output stream or else PHP will hang until the execution of the program ends.