Strange problem with running php from within a cgi program in Apache 1.3

Strange problem with running php from within a cgi program in Apache 1.3

Post by pani » Tue, 29 Oct 2002 05:30:28



Hello,
Ok First let me tell you what I am trying to do; I have 2 programs, one in
C and one in php that I want to have be able to run the php script from
within the C program with a system("/usr/bin/php script.php").  And it
works fine on my home server, but on the production server it doesn't
work.  Note that servers are not exactly the same(different modules,etc.)
What I mean by doesn't work is the wierd part.  Instead of giving me an
error, what it does is actually insert the cgi program where the system()
call is.  I have actually reproduced this with a simple bash script
bash.cgi:

#!/bin/bash
export REDIRECT_STATUS=200; # Keep php from generating security warning.
echo "Content-type: text/html\n\n"
/usr/bin/php -v
echo ""

Instead of just printing "4.2.2", the script source gets outputted.  What
it seems like is instead of just running the script, the php is actually
executing the cgi script like "php bash.cgi".   I don't understand why it
is doing this, and I was wondering if anyone could give me some insight.

Note: Both programs are too big to rewrite in one language, and I cannot
upgrade to apache 2.0.

Thanks,
Brian

 
 
 

1. Can't run ~someuser/cgi-bin/somescript apache 1.3 on RH 7.2

I'm running apache 1.3.22 on a Red Hat 7.2 system.

I'd like to run scripts in /home/someUser/public_html/cgi-bin/.

I added:

<Directory /home/*/public_html/cgi-bin>
        Options ExecCGI
</Directory>

to my httpd.conf yet they still dont run.

What am I missing?

Mark Healey
marknews(the 'at' thing)healeyonline.com

2. Win A Ferrari F355

3. Help in running CGI with Apache 1.3 on Win32

4. ni5010 driver alpha available

5. Problems running PHP as CGI under Apache, please help!

6. freezes on bootup!

7. Apache 1.3 and PHP Problem

8. IPSec UDP and Linux

9. apache 1.3.x cgi - script problem

10. cgi problem - Apache 1.3.4win32

11. apache(1.3)+php+mod_perl install

12. Compiling Apache 1.3.x with PHP and Oracle 7.3.4 on HPUX11

13. child process within CGI running on APACHE http server