先將XAMPP安裝完成後,再準備apache,將資料夾權限開好,想要對apache權限問題有詳情說明,請直接拜請google大神。
C:\apache\conf\httpd.conf
位於
# Example:
# LoadModule foo_module modules/mod_foo.so
#
加上下列兩行
LoadModule php5_module c:/xampp/php/php5apache2.dll
AddType application/x-httpd-php .php
位於DirectoryIndex
DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml
請確認DirectoryIndex 後方要有index.php
位於
DocumentRoot "C:/xampp/htdocs"
#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
改成
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order deny,deny
Allow from all
位於
加入下列幾行
Alias /tshirtshop/ "c:/www/tshirtshop/"
Alias /tshirtshop "c:/www/tshirtshop"
Alias /php5/ "c:/www/php5/"
Alias /php5 "c:/www/php5"
Alias /appointments/ "c:/www/appointments/"
Alias /appointments "c:/www/appointments"
php.ini的環境也必須經過調整─c:\xampp\apach\bin\php
; Safe Mode
;
safe_mode = On 改成 Off
;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;
max_execution_time = 60 ; Maximum execution time of each script, in seconds (將60改成300)
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
memory_limit = 32M ; Maximum amount of memory a script may consume (16MB) (32M改成64M)
位於
; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.
下方的extension=前方的; 刪除掉,取消註解,才可以開啟延伸模組
extension=php_mhash.dll
extension=php_mcrypt.dll
extension=php_curl.dll
如此設定完成即可安裝Smart 還有 PEAR
Smart安裝
http://smarty.php.net 下載選擇新版的smarty 目前最新的版本是smarty2.6.22.zip,解壓縮完後,將檔案置於c:/www/tshirtshop/libs/smarty中
PEAR安裝
將http://pear.php.net/go-pear另存新檔,存在c:/www/tshirtshop/libs/PEAR
用瀏覽器開啟http://localhost/tshirtshop/libs/PEAE/go-pear.php
PEAR安裝之後,須將 c:\xampp\apache\bin\php.ini 檔案中
位於
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
include_path = ".;C:\www\tshirtshop\libs\PEAR\PEAR;c:\www\tshirtshop\appointments\includes\" (將include_path=改成PEAR所在路逕,並將include_path前方的;刪除)
並將控制台─系統─進階─環境變數─PATH中,選擇編輯,加入c:\www\tshirtshop\libs 。
然後從新開機,啟動Apache還有MySQL,兩個Server的服務,直接到xampp中選取apache_star、mysql_star等這兩個服務,就可以開使進入到PEAR,然後就剩下安全設定即可。
若是有買 PHP 5 and MySQL購物網站開發技術 的朋友,從http://cristian.nexcess.net/看到展示頁面,http://www.apress.com/book/downloadfile/1905找到Download Now即可下載範例檔。
買書不看可惜,玩PHP、PEAR又要從Apache、MySQL開始準備環境,還好現在有xampp各式的套件包方便許多,但對於許多不玩Linux享受自由軟體的朋友,這樣的準備過程真的是困難重重,
過程繁雜,所以自己玩過之後,乾脆將過程寫下,讓別人方便,也避免自己忘記,若是有問題多搜尋吧。
主要環境準備:
apache─環境設定c:\apache\bin\php.ini , c:\apache\conf\httpd.conf
所以要注意這些設定檔,當然這些設定,若要詳細的設定說明,直接搜尋檔名都可以找到說明。
也歡迎PHP的同好,一起留言討論吧。
Mark One
C:\apache\conf\httpd.conf
位於
# Example:
# LoadModule foo_module modules/mod_foo.so
#
加上下列兩行
LoadModule php5_module c:/xampp/php/php5apache2.dll
AddType application/x-httpd-php .php
位於DirectoryIndex
DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml
請確認DirectoryIndex 後方要有index.php
位於
DocumentRoot "C:/xampp/htdocs"
#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
改成
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order deny,deny
Allow from all
位於
加入下列幾行
Alias /tshirtshop/ "c:/www/tshirtshop/"
Alias /tshirtshop "c:/www/tshirtshop"
Alias /php5/ "c:/www/php5/"
Alias /php5 "c:/www/php5"
Alias /appointments/ "c:/www/appointments/"
Alias /appointments "c:/www/appointments"
php.ini的環境也必須經過調整─c:\xampp\apach\bin\php
; Safe Mode
;
safe_mode = On 改成 Off
;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;
max_execution_time = 60 ; Maximum execution time of each script, in seconds (將60改成300)
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
memory_limit = 32M ; Maximum amount of memory a script may consume (16MB) (32M改成64M)
位於
; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.
下方的extension=前方的; 刪除掉,取消註解,才可以開啟延伸模組
extension=php_mhash.dll
extension=php_mcrypt.dll
extension=php_curl.dll
如此設定完成即可安裝Smart 還有 PEAR
Smart安裝
http://smarty.php.net 下載選擇新版的smarty 目前最新的版本是smarty2.6.22.zip,解壓縮完後,將檔案置於c:/www/tshirtshop/libs/smarty中
PEAR安裝
將http://pear.php.net/go-pear另存新檔,存在c:/www/tshirtshop/libs/PEAR
用瀏覽器開啟http://localhost/tshirtshop/libs/PEAE/go-pear.php
PEAR安裝之後,須將 c:\xampp\apache\bin\php.ini 檔案中
位於
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
include_path = ".;C:\www\tshirtshop\libs\PEAR\PEAR;c:\www\tshirtshop\appointments\includes\" (將include_path=改成PEAR所在路逕,並將include_path前方的;刪除)
並將控制台─系統─進階─環境變數─PATH中,選擇編輯,加入c:\www\tshirtshop\libs 。
然後從新開機,啟動Apache還有MySQL,兩個Server的服務,直接到xampp中選取apache_star、mysql_star等這兩個服務,就可以開使進入到PEAR,然後就剩下安全設定即可。
若是有買 PHP 5 and MySQL購物網站開發技術 的朋友,從http://cristian.nexcess.net/看到展示頁面,http://www.apress.com/book/downloadfile/1905找到Download Now即可下載範例檔。
買書不看可惜,玩PHP、PEAR又要從Apache、MySQL開始準備環境,還好現在有xampp各式的套件包方便許多,但對於許多不玩Linux享受自由軟體的朋友,這樣的準備過程真的是困難重重,
過程繁雜,所以自己玩過之後,乾脆將過程寫下,讓別人方便,也避免自己忘記,若是有問題多搜尋吧。
主要環境準備:
apache─環境設定c:\apache\bin\php.ini , c:\apache\conf\httpd.conf
所以要注意這些設定檔,當然這些設定,若要詳細的設定說明,直接搜尋檔名都可以找到說明。
也歡迎PHP的同好,一起留言討論吧。
Mark One
全站熱搜
留言列表