標籤:style ext color http c strong
很久沒裝環境, 今天重新裝了一次。遇到不少問題。記錄下方便以後查看
修改apache的設定檔httpd.conf
#apache 解析php
LoadFile "C:/phpeve/php52/libmysql.dll" 載入dll檔案。不用把檔案放入system32檔案夾下
LoadModule php5_module "C:/phpeve/php52/php5apache2_2.dll"
PHPIniDir "C:/phpeve/php52/php.ini" 指向php.ini的檔案目錄
AddType application/x-httpd-php .php
AddType application/x-httpd-php .htm
apache虛擬機器主機配置
NameVirtualHost *:80
<VirtualHost *:80>
#網站根目錄
DocumentRoot "D:/WWW/"
#綁定網域名稱
ServerName www.xxx.net
#配置錯誤頁面和錯誤記錄檔
ErrorDocument 404 /missing.html
ErrorLog "logs/www.xxxx.com-error.log"
</VirtualHost>
#配置網站目錄存取權限
<Directory "D:/WWW/">
Options FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
#配置301重新導向
<VirtualHost *:80>
ServerName xxx.net
RedirectMatch permanent ^/(.*) http://www.xxx.net/$1
</VirtualHost>
php.ini的配置
配置ext的路徑。
extension_dir = "C:/phpeve/php52/ext/"
開啟對應的拓展庫
extension=php_bz2.dll
extension=php_curl.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_mbstring.dll
extension=php_mcrypt.dll
extension=php_pdo.dll
extension=php_pdo_mysql.dll
設定時區
date.timezone =PRC
設定編碼
default_charset = "utf-8"
配置session
session.save_handler = files session儲存方式 檔案
session.save_path = "c:/tmp" //session儲存路徑
session.name = PHPSESSID session name的名字
配置upload
file_uploads = On 允許檔案上傳
upload_tmp_dir ="c:/temp/"
upload_max_filesize = 2M 上傳檔案的大小