PHP, kill Windows process?
-
13-06-2021 - |
Question
Is there a way to kill a Windows process, say calc.exe
, with PHP without using exec
?
exec
calls an external program, I try to avoid using that command unless necessary.
Solution
There is.
Use the W32api
PHP extension, which provides access to the Win32 API - then use the TerminateProcess()
API after aquiring a handle to the process.
OTHER TIPS
- define new function in PHP sources ( pure C )
- compile you new PHP version with the defined function
- call the new function, which was defined in PHP sources by you
PS
On this way you are able to make PHP able work with __asm { } insertions/add some kernel code , if you want it...
No, there isn't. PHP has little access to the system except through exec
.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow