久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁技術文章
文章詳情頁

python - 用Mac自帶的Apache服務器開發CGI,在瀏覽器直接輸出純文本了?求解

瀏覽:162日期:2022-07-18 18:49:21

問題描述

httpd.conf文件頁配置安裝教程http://blog.csdn.net/dabiaoya...一步一步的來的文件權限如下

GhostClock:WWW ghostclock$ ls -al Test.py -rwxr-xr-x 1 ghostclock staff 410 May 9 20:40 Test.pyGhostClock:WWW ghostclock$

在瀏覽器輸入localhost/Test.py后,打印的是純文本

#!/usr/bin/env python# -*- coding: UTF-8 -*-print 'Content-type:text/html'print # 空行,告訴服務器結束頭部print ’<html>’print ’<head>’print ’<meta charset='utf-8'>’print ’<title>Hello Word - CGI 程序!</title>’print ’</head>’print ’<body>’print ’<h2>Hello Word! 第一CGI程序</h2>’print ’</body>’print ’</html>’

不知道我哪里環境沒配置好,求解

問題解答

回答1:

添加了AddHandler cgi-script .py了嗎, 添加之后記得重啟apache

標簽: Python 編程
主站蜘蛛池模板: 阿尔山市| 阳山县| 泸水县| 郁南县| 吴川市| 蓝田县| 海南省| 墨竹工卡县| 延津县| 黑水县| 石家庄市| 布拖县| 大洼县| 客服| 准格尔旗| 鄂托克前旗| 平顺县| 田阳县| 高青县| 资中县| 民乐县| 荆门市| 习水县| 平原县| 竹溪县| 湖南省| 绩溪县| 曲靖市| 手游| 东乌珠穆沁旗| 葵青区| 都江堰市| 抚顺市| 聊城市| 南平市| 本溪市| 宁明县| 南涧| 玛多县| 横峰县| 安国市|