hi

I have a problem with this source code

#fi, fo = os.popen2('c:/python24/python.exe C:/AppServ/webserver/www/index.pyw')
            #fi, fo = os.popen2('c:/Perl/bin/perl.exe C:/AppServ/webserver/www/wwwp.pl')    
            fi, fo = os.popen2('c:/appserv/php/php.exe C:/AppServ/webserver/www/wphp.php')
            data = self.rfile.read(nbytes)
            fi.write(data)
            fi.close()
            shutil.copyfileobj(fo, self.wfile)
            sts = fo.close()

when I try with python or perl it works but with php not.

first it is

Security Alert! The PHP CGI cannot be accessed directly.
This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive.

and when I edit php.ini with
cgi.force_redirect = 1

and then it is.....

No input file specified.

but in python make more errors when I make this with php
please help me

10x

Recommended Answers

All 5 Replies

This is tough! I simply don't have enough information to help you.

it works with php5
10x:)

Any idea why it didn't work with other versions of php?

i don't know maybe the problem is in

http://bugs.php.net/bug.php?id=22127&edit=2

Security Alert! The PHP CGI cannot be accessed directly.
This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive.


Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

... with this in php is ok byt in python no....
also
cgi.force_redirect = 1

Interesting, thanks for your observations. I hope other programmers will benefit too!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.