proc_open


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users proc_open
# 1  
Old 08-02-2006
proc_open

Hi,

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() Smilie

Thanks in advance!
# 2  
Old 08-03-2006
# 3  
Old 08-03-2006
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:

Code:
function exec_alternative($cmd)
{
   return proc_close(proc_exec($cmd, array(), $foo));
}

The problem is, proc_close returns exit code, while exec() returns last line of result.

Last edited by rayne; 08-03-2006 at 10:25 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question