473,467 Members | 1,300 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

calling php interpreter via my test web server

Hi
currently i'm developing simple web server which support cgi with
python in win32.
and i started from python's basic library, CGIHTTPServer.
it support cgi but only for extension like .exe .py.
so now i just wanna add php extension
here's cgi handling schem of this webserver.
first it check requested file's extension. and then if it is 'py' then
it call's popen2('python requested-script'). now we can handle input
and output file descriptor of this process.

it's very simple :)
so i add some code for handling php likewise.
first i turned off the cgi.force_redirect.
and called popen2('python some-request-script') but it shows 'No input
file specified'
i tested this thing's in python's interactive interpreter in directly
then it shows right. let me show some code
files = os.popen2("c:\php\php.exe c:\\test.php")
files[1].read()

"Content-type: text/html\nX-Powered-By: PHP/4.3.5\n\nhere's php"

but when i run this code via http server, it seems that 'c:\\test.php'
doesn't passed to 'c:\php\php.exe' or php.exe waste stdin.

how can i handle this problem?
any posting would be appreciated :)

ps.is there anyone who made supporting for php interpretion with own
web server? please let me show some example.
Jul 17 '05 #1
1 2420
bu******@daum.net (bucket79) wrote in message news:<95*************************@posting.google.c om>...
Hi
currently i'm developing simple web server which support cgi with
python in win32.
and i started from python's basic library, CGIHTTPServer.
it support cgi but only for extension like .exe .py.
so now i just wanna add php extension
here's cgi handling schem of this webserver.
first it check requested file's extension. and then if it is 'py' then
it call's popen2('python requested-script'). now we can handle input
and output file descriptor of this process.

it's very simple :)
so i add some code for handling php likewise.
first i turned off the cgi.force_redirect.
and called popen2('python some-request-script') but it shows 'No input
file specified'
i tested this thing's in python's interactive interpreter in directly
then it shows right. let me show some code
files = os.popen2("c:\php\php.exe c:\\test.php")
files[1].read()

"Content-type: text/html\nX-Powered-By: PHP/4.3.5\n\nhere's php"

but when i run this code via http server, it seems that 'c:\\test.php'
doesn't passed to 'c:\php\php.exe' or php.exe waste stdin.

how can i handle this problem?
any posting would be appreciated :)

ps.is there anyone who made supporting for php interpretion with own
web server? please let me show some example.


Not sure, but sounds like problem with slash.

What about using c:\\php\\php.exe ?

--
http://www.sendmetoindia.com - Send Me to India!
Email: rrjanbiah-at-Y!com
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: BaBS | last post by:
I've a problem whith my python script, i chmod'ed it to +x, addes the line : #!/usr/bin/python2.3 and i verified that /usr/bin/python2.3 exists but i've something like : bad interpreter: No such...
3
by: Rakesh | last post by:
In my Python code fragment, I want to write a code fragment such that the minimum element of a tuple is subtracted from all the elements of a given tuple. When I execute the following python...
1
by: ZeBerg | last post by:
Is it possible to have a stored procedure in database A while calling it from database B and have it manipulate the tables in database B (whatever the calling database happens to be)? We have a...
7
by: Ryan | last post by:
I was wondering if anyone could lend a hand with the following issue... I am testing application code (C++) that is currently built for the VxWorks platform. When loading in the object code (ld...
15
by: Bryan | last post by:
I have a multi-threaded C# console application that uses WMI (System.Management namespace) to make RPC calls to several servers (600+ ) and returns ScheduledJobs. The section of my code that...
8
by: akameswaran | last post by:
I wrote up a quick little set of tests, I was acutally comparing ways of doing "case" behavior just to get some performance information. Now two of my test cases had almost identical results which...
16
by: lawrence k | last post by:
I've never before written a PHP script to run on my home Ubuntu machine (though I've written dozens of PHP cron jobs for my web server), so I thought I'd start off with a very simple test: ...
40
by: castironpi | last post by:
I'm curious about some of the details of the internals of the Python interpreter: I understand C from a hardware perspective. x= y+ 1; Move value from place y into a register Add 1 to the...
6
by: Ole Nielsby | last post by:
VC has a __cdecl specifier which allows functions and methods to be called with varying parameter count. (I understand this is the default for functions in general but in VC, instances use...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.