making system calls from a php extension

From: Date: Wed, 11 May 2011 03:42:58 +0000
Subject: making system calls from a php extension
Groups: php.internals 
Request: Send a blank email to internals+get-52265@lists.php.net to get a copy of this message
hello everyone! I'm trying to gain some speed by moving a function from PHP legacy code to C and making an extension. I'm trying to call *lynx* from the command line since their C api isn't something soo nice likely to use it as any other libXX Currently in PHP I'm doing a system call by using *proc_open* and sending and getting the response. Moving the code to C code I found that I need a "bidirectional" popen to replicate the PHP behavior, and since this is not allowed/implemented by default on POSIX environments I'm forced to fork to get this working. So back to my question: How feasible is to make fork calls on a PHP extension? Can I just do it or should I use php_stream_* functions to get a stream and make the system call? To avoid some questions the main idea of this extension is to be used on POSIX environments, so basically I dont care if this is not compatible with Windows. Thanks for your time. -- Gabriel Sosa Si buscas resultados distintos, no hagas siempre lo mismo. - Einstein

« previous php.internals (#52265) next »