Calling cgi programsfrom php script

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
mailsink
Forum Newbie
Posts: 1
Joined: Fri Jul 11, 2003 11:14 am

Calling cgi programsfrom php script

Post 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.
hedge
Forum Contributor
Posts: 234
Joined: Fri Aug 30, 2002 10:19 am
Location: Calgary, AB, Canada

Post 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.
Post Reply