VFPCGI Day3

出自VFP Wiki

跳轉到: 導航, 搜尋
VFPCGI的第三天

因為 CGI 是 Web server 共同 follow 的標準,因此當然也適用於 Apache。

我的環境:Windows 2000 + Apache 2.2.3

在安裝 Apache 之後,修改 httpd.conf (開始 > 程式集 > Apache HTTP Server 2.2.3 > Configure Apache Server > Edit the Apache httpd.conf Configuration File

添加以下內容:(對了,路徑記得自行修改,\ 都要改為 /)

#
# VFPCGI
#
Alias /vfpcgi/ "d:/vfpces/vfpcgi/"
<Directory "d:/vfpces/vfpcgi">
    AllowOverride None
    Options ExecCGI
    Order allow,deny
    Allow from all
    AddHandler cgi-script exe
</Directory>

存檔之後,啟動 Apache (用"服務")。

接著我們要修改一下昨天的程式,將

lcOutput = "HTTP/1.0 200 OK"+chr(13)+chr(10) + 
        "Content-type: text/html"+chr(13)+chr(10) + ;
	CHR(13) + CHR(10)

改為

lcOutput = "Content-type: text/html"+chr(13)+chr(10) + ;
	CHR(13) + CHR(10)

同樣的,進行編譯,接著打開瀏覽器,在網址列輸入:http://localhost/vfpcgi/vfpcgi.exe

就會看到昨天的肉了~(放了一天的肉,可能有點酸了~)