My server has disabled exec() of PHP, but they still left proc_open() available for the task. The problem is, I don't know how to use proc_open()!
I just want to simulate exec() with proc_open(), so can someone write a little script such as exec_alternative() that works as exec() but uses proc_open() actually? Or at least shed some light how to use proc_open() like exec()
Geee. I've seen that ages ago. And it didn't help a bit.
I don't want any pipes for stdout, stdin, stderr, etc. I simply want to mimic exec(), I want something that should work exectly as exec(), but uses proc_open and proc_close(). I tried this, but it didn't seem to be working:
The problem is, proc_close returns exit code, while exec() returns last line of result.