Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/363.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python CGI脚本内部服务器错误窗口_Python_Cgi - Fatal编程技术网

Python CGI脚本内部服务器错误窗口

Python CGI脚本内部服务器错误窗口,python,cgi,Python,Cgi,我不熟悉CGI脚本。我已经在Windows上安装了Wamp服务器,并在路径D:\Installation\Python33上安装了Python 我已将CGI脚本(test.CGI)编写为: 我认为Python路径需要在这里设置 我在这里发现了类似的问题: 但找不到如何在windows上设置python路径。请帮忙 提前感谢。将脚本放入C:\wamp\bin\apache\apache2.2.22\cgi-bin (如果没有cgi bin文件夹,请创建一个) 然后在您的“httpd.conf”

我不熟悉CGI脚本。我已经在Windows上安装了Wamp服务器,并在路径D:\Installation\Python33上安装了Python

我已将CGI脚本(test.CGI)编写为:

我认为Python路径需要在这里设置

我在这里发现了类似的问题:

但找不到如何在windows上设置python路径。请帮忙


提前感谢。

将脚本放入
C:\wamp\bin\apache\apache2.2.22\cgi-bin

(如果没有cgi bin文件夹,请创建一个)

然后在您的
“httpd.conf”

i、 e.找到
并用它替换(在
httpd.conf
文件中)


将脚本放入
C:\wamp\bin\apache\apache2.2.22\cgi-bin

(如果没有cgi bin文件夹,请创建一个)

然后在您的
“httpd.conf”

i、 e.找到
并用它替换(在
httpd.conf
文件中)


将脚本放入
C:\wamp\bin\apache\apache2.2.22\cgi-bin

(如果没有cgi bin文件夹,请创建一个)

然后在您的
“httpd.conf”

i、 e.找到
并用它替换(在
httpd.conf
文件中)


将脚本放入
C:\wamp\bin\apache\apache2.2.22\cgi-bin

(如果没有cgi bin文件夹,请创建一个)

然后在您的
“httpd.conf”

i、 e.找到
并用它替换(在
httpd.conf
文件中)


最终找到了解决方案:

我修改了第一行以设置python路径,然后使用sys模块将输出写入:

#!d:/Installations/Python33/python.exe

import sys
sys.stdout.write("Content-type: text/html\r\n\r\n")
sys.stdout.write("<html><head><title>Books</title></head>")
sys.stdout.write("<body><h1>Books</h1>These are the books</body></html>")
#!d:/Installations/Python33/python.exe
导入系统
sys.stdout.write(“内容类型:text/html\r\n\r\n”)
系统标准编写(“书籍”)
sys.stdout.write(“这些是书”)

成功了

终于找到了解决方案:

我修改了第一行以设置python路径,然后使用sys模块将输出写入:

#!d:/Installations/Python33/python.exe

import sys
sys.stdout.write("Content-type: text/html\r\n\r\n")
sys.stdout.write("<html><head><title>Books</title></head>")
sys.stdout.write("<body><h1>Books</h1>These are the books</body></html>")
#!d:/Installations/Python33/python.exe
导入系统
sys.stdout.write(“内容类型:text/html\r\n\r\n”)
系统标准编写(“书籍”)
sys.stdout.write(“这些是书”)

成功了

终于找到了解决方案:

我修改了第一行以设置python路径,然后使用sys模块将输出写入:

#!d:/Installations/Python33/python.exe

import sys
sys.stdout.write("Content-type: text/html\r\n\r\n")
sys.stdout.write("<html><head><title>Books</title></head>")
sys.stdout.write("<body><h1>Books</h1>These are the books</body></html>")
#!d:/Installations/Python33/python.exe
导入系统
sys.stdout.write(“内容类型:text/html\r\n\r\n”)
系统标准编写(“书籍”)
sys.stdout.write(“这些是书”)

成功了

终于找到了解决方案:

我修改了第一行以设置python路径,然后使用sys模块将输出写入:

#!d:/Installations/Python33/python.exe

import sys
sys.stdout.write("Content-type: text/html\r\n\r\n")
sys.stdout.write("<html><head><title>Books</title></head>")
sys.stdout.write("<body><h1>Books</h1>These are the books</body></html>")
#!d:/Installations/Python33/python.exe
导入系统
sys.stdout.write(“内容类型:text/html\r\n\r\n”)
系统标准编写(“书籍”)
sys.stdout.write(“这些是书”)

成功了

在test.py中使用此代码

#!python

print ("Content-type: text/html\n")
print ("python test ok\r\n<br/>")
#print (help)
help (os.chmod())
#!python
打印(“内容类型:text/html\n”)
打印(“python测试正常\r\n
”) #打印(帮助) 帮助(os.chmod())
并将D:\Installation\Python33放入路径变量中

重新启动apache

注意:Wamp服务器必须安装在D驱动器中


我希望这能起作用

在test.py中使用此代码

#!python

print ("Content-type: text/html\n")
print ("python test ok\r\n<br/>")
#print (help)
help (os.chmod())
#!python
打印(“内容类型:text/html\n”)
打印(“python测试正常\r\n
”) #打印(帮助) 帮助(os.chmod())
并将D:\Installation\Python33放入路径变量中

重新启动apache

注意:Wamp服务器必须安装在D驱动器中


我希望这能起作用

在test.py中使用此代码

#!python

print ("Content-type: text/html\n")
print ("python test ok\r\n<br/>")
#print (help)
help (os.chmod())
#!python
打印(“内容类型:text/html\n”)
打印(“python测试正常\r\n
”) #打印(帮助) 帮助(os.chmod())
并将D:\Installation\Python33放入路径变量中

重新启动apache

注意:Wamp服务器必须安装在D驱动器中


我希望这能起作用

在test.py中使用此代码

#!python

print ("Content-type: text/html\n")
print ("python test ok\r\n<br/>")
#print (help)
help (os.chmod())
#!python
打印(“内容类型:text/html\n”)
打印(“python测试正常\r\n
”) #打印(帮助) 帮助(os.chmod())
并将D:\Installation\Python33放入路径变量中

重新启动apache

注意:Wamp服务器必须安装在D驱动器中


我希望这能奏效

@vijay您正在使用python33。所以打印功能是如下打印(“您的内容”)而不是像打印“您的内容”@vijay您正在使用python33。所以打印功能是如下打印(“您的内容”)而不是像打印“您的内容”@vijay您正在使用python33。所以打印功能是如下打印(“您的内容”)而不是像打印“您的内容”@vijay您正在使用python33。所以打印功能是如下打印(“你的内容”)不喜欢打印“你的内容”,但为什么不简单打印(“hello world”)不在这里工作它工作,但为什么不简单打印(“hello world”)不在这里工作它工作,但为什么不简单打印(“hello world”)不在这里工作它工作,但为什么不简单打印(“hello world”)不在这里工作