%1 is not a valid Win32 application?

M

Mark Space

Hi all, I followed some simple instructions to add python scrips to IIS
as a cgi. The instructions were here:

http://www.e-coli.net/pyiis.html

Unfortunately, when I try to run a test script, I get this message
displayed on my browser window:

%1 is not a valid Win32 application.

That's it! No 500 error, nothing else. I'm not sure what is generating
this message so I'm asking various groups here what might be the issue.

I'm totally at a loss how to move forward. Anyone know? I'll even take
vague suggestions at this point. ;)

Is this error message comming from IIS or is it possibly python? Note
my python instal seems to work ok (runs from command line just fine,
etc.) The test app I'm using (named test.cgi) right now is in a
directory that's already been linked to an IIS virtual directory, from
which I can run ASP scripts just fine. Permissions and ownership should
all be the same. (The permissions on the virtual directory from IIS are
Scrips and Executeables). The test script is here, should you care:

print "Content-type: text/html\n"
print "<h3>Hello World!</h3>"
print "<p>"
print "Well this is just a basic test, mkay?"
print "If this had been a real test there would have been lots more
here, mkay?"
 
M

Mark Space

Just a quick update:

I decided to rename the extension for python scripts ".pycgi". Ok, so
when I did so, I decided to test. Result: with .pycgi in the IIS Admin
properties, test.cgi STILL returns "%1 is not a valid Win32
application." Wow. So it's like IIS is ignoring the .cgi rule I added
somehow.

Second, once I renamed test.cgi to test.pycgi, the file time is totally
unrecognized. My browser (Mozilla) declares the type of test.pycgi to
be unrecognized and askes me if I want to download instead. I even
added the .pycgi rule to the vitual directory where the script lives and
I get the same result.

Help!
 
M

Mark Space

Update #2:

Renamed the extension yet again, this time to .py. Mozilla seems to
recognize this as a text file and displays it, but IIS still doesn't
seem to catch the .py rule I added to the IIS Admin properties. The
script is still not being executed.

Win2K Pro, IIS 5.0. SP4 and current on all updates.

Man I hope someone can help, I'm really lost here. I think I'll try to
add perl as a script just to see if I can get it to work.
 
C

Christopher Koppler

Mark Space said:
Update #2:

Renamed the extension yet again, this time to .py. Mozilla seems to
recognize this as a text file and displays it, but IIS still doesn't
seem to catch the .py rule I added to the IIS Admin properties. The
script is still not being executed.

Win2K Pro, IIS 5.0. SP4 and current on all updates.

Man I hope someone can help, I'm really lost here. I think I'll try to
add perl as a script just to see if I can get it to work.

Hmm... have you checked your system's environment variables? This
error message sounds like maybe "PATHEXT" needs to be set to include
".PY" (to make Python scripts executable)... although having no
experience with IIS whatsoever this is only a stab in the dark, and
bursts of sudden pigeons might still be lurking.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,266
Messages
2,571,085
Members
48,773
Latest member
Kaybee

Latest Threads

Top