Page 1 of 1

Calling cgi programsfrom php script

Posted: Fri Jul 11, 2003 11:14 am
by mailsink
Greetings,

This may sound nuts, but I was wondering if it it possible to call another cgi-script from php?

I would like to use php in general, but I have C++ libraries/programs that interface to proprietary servers, which can't be called from php.

As the next best thing, I would like to invoke a cgi (C++ program) using popen() and read it's output (HTML fragment code).

I can do the popen() and print a program's output fine.

I'm wondering if the program called via php/popen() has the same environment variables needed by a cgi program?

Any advice suggestions would be much appreciated,

Thanks for the assistance,
Curt C.

Posted: Fri Jul 11, 2003 11:41 am
by hedge
If I understood you correctly this should help viewtopic.php?t=7063

It is some code I put together to be able to call other scripts, I believe you can also use the curl library.