woff 發表於 2010-12-17 12:19:27

html 執行 php

只要經過適當的設定,.html 也能執行 PHP,有兩種實作模式:

以下內容需要回復才能看到


(1)需要透過 httpd.conf and php.ini
在 httpd.conf 的 mod_mime.c 段落中加入:
AddType application/x-httpd-php .html

在 php.ini 加入:

include_path = ".:/path/to/folder"
這裡的path 指的是系統底下程式的路徑...
再 restart apache 即可。


(2)不需要透過 httpd.conf and php.ini
在 .htaccess 中加入:

AddType application/x-httpd-php .html
php_value include_path .:/path/to/folder

這樣就可以了。
頁: [1]
查看完整版本: html 執行 php