按原样执行 python PHP
Executing python as it was PHP
我正在尝试遵循 this tutorial,其中他在服务器端执行 python 脚本,并仅使用打印生成 HTML 代码,这是我的代码:
print 'Content-Type: text/HTML';
print;
print '<h1>Hello World</h1>';
但是当我转到 http://localhost:5500/mysite/tests/helloworld.py 时,它实际上只是显示源代码,不像教程那样。
教程里他用的是XAMPP,我用的是WAMPP
我该怎么办?
也许 WAMPP 默认没有 Python 模块 enabled/installed。
请检查此主题:How to install Python with Wampserver
了解如何在 WAMPP 环境中安装和启用 Python 模块。
您需要为您的网络服务器配置 cgi:http://httpd.apache.org/docs/2.2/howto/cgi.html 和 运行 cgi-bin 中的 .py 文件。
我正在尝试遵循 this tutorial,其中他在服务器端执行 python 脚本,并仅使用打印生成 HTML 代码,这是我的代码:
print 'Content-Type: text/HTML';
print;
print '<h1>Hello World</h1>';
但是当我转到 http://localhost:5500/mysite/tests/helloworld.py 时,它实际上只是显示源代码,不像教程那样。
教程里他用的是XAMPP,我用的是WAMPP
我该怎么办?
也许 WAMPP 默认没有 Python 模块 enabled/installed。
请检查此主题:How to install Python with Wampserver
了解如何在 WAMPP 环境中安装和启用 Python 模块。
您需要为您的网络服务器配置 cgi:http://httpd.apache.org/docs/2.2/howto/cgi.html 和 运行 cgi-bin 中的 .py 文件。