++++++++++++++++++++++++++++++++++++++++++++++
Windows下LAMP環境搭建
++++++++++++++++++++++++++++++++++++++++++++++
操作系統 : [windows xp professional sp3]
服務器 : [apache-2.2.8]
PHP : [php-5.2.17]
數據庫 : [mysql-5.1.49]
數據庫管理工具 : [phpmyadmin-3.3]
++++++++++++++++++++++++++++++++++++++++++++++
準備安裝軟件(download)
1> [apache_2.2.8-win32-x86-openssl-0.9.8g]
http://archive.apache.org/dist/httpd/binaries/win32/apache_2.2.8-win32-x86-openssl-0.9.8g.msi
2> [php-5.2.17-Win32-VC6-x86]
http://windows.php.net/downloads/releases/php-5.2.17-Win32-VC6-x86.zip
3> [mysql-5.1.49]
http://www.mysql.com/downloads/mirror.php?id=398365(需註冊)
4> [phpMyAdmin-3.3.9-all-languages]
http://sourceforge.net/projects/phpmyadmin/files%2FphpMyAdmin%2F3.3.9%2FphpMyAdmin-3.3.9-all-languages.zip/download#!md5!3d5ec3d2023946bbca9c4dd182722c8b
++++++++++++++++++++++++++++++++++++++++++++++
開始安裝(安裝前建立目錄[D:/lamp])
D:/lamp
--apache2.2
--php
--mysql
--sites
----------------------------------------------------------------------------
1> 【apache】
----------------------------------------------------------------------------
1.1> Welcome to the Installation Wizard for Apache HTTP Server 2.2.8
#單擊[Next>]
1.2> License Agreement
#選擇(I accept the terms in the license agreement)->單擊[Next>]
1.3> Read This First
#單擊[Next>]
1.4> Server Information
Network Domain(e.g.somenet.com): [helloworld.com]
Server Name(e.g.www.somenet.com): [www.helloworld.com]
Administrator's Email Address([email protected]): [[email protected]]
#選擇(for All Users, on Port 80, as a Service -- Recommended.), 單擊[Next>]
1.5> Setup Type
#選擇(Custom), 單擊[Next>]
1.5> Custom Setup
單擊[Change...],
1.5.1> Change Current Destination Folder
Folder name: [D:/lamp/apache2.2/], 單擊[OK],
#單擊[Next>]
1.6> Ready to Install the Program
#單擊[Install]
1.7> Installaction Wizard Completed
#單擊[Finish]
----------------------------------------------------------------------------
2> 【php】
2.1> 將php-5.2.17-Win32-VC6-x86.zip解壓到[D:/lamp/php]
----------------------------------------------------------------------------
3> 【mysql】
3.1> Welcome o the Setup Wizard for MySQL Server 5.1
#單擊[Next>]
3.2> Setup Type
#選擇Custom, 單擊[Next>]
3.3> Custom Setup
3.3.1> 單擊[Change...],
3.3.2> Change Current Destination Folder
Folder name: [D:/lamp/mysql/]
單擊[OK]
#單擊[Next>]
3.4> Ready to Install the Program
#單擊[Install]
3.5> A MySQL Enterprise subscription is the most...
#單擊[Next>]
3.6> The MySQL Enterprise Monitor Service
#單擊[Next>]
3.7> Wizard Completed
#勾選[Configure the MySQL Server now]
#單擊[Finish]
3.8> Welcome to the MySQL Service Instance Configuration Wizard 1.0.17.0
#單擊[Next>]
3.9> MySQL服務器實例配置[MySQL Server Instance Configuration]
Detailed Configuration-詳細配置
Standard Configuration-標準配置
#選擇默認[Detailed Configuration]
#單擊[Next>]
3.9.1> 服務器類型[Please select a server type. This will influence memory, disk and CPU usage.]
[Developer Machine]-開發服務器, 佔用內存較少
[Server Machine]-多個服務器共用, 佔用內存中等
[Dedicated MySQL Server Machine]-專用服務器, 佔用內存較多
#選擇默認[Developer Machine]
#單擊[Next>]
3.9.2> 數據庫用途[Please select the database usage]
[Multifunctional Database]-多功能數據庫,優化InnoDB,MyISAM
[Transactional Database Only]-事務數據庫,優化InnoDB,MyISAM也可用
[Non-Transactional database Only]-非事務性數據庫,適用於簡單的網絡監控或記錄的應用發有分析僅非事務的MyISAM引擎
#選擇默認[Multifunctional Database]
#單擊[Next>]
3.9.3> InnoDB的數據文件的存放位置[Please select the driver for the InnoDB datafile, if you do not want to use the default settings]s
#選擇默認
#單擊[Next>]
3.9.4> 設置併發連接到服務器的大致數量[Please set the approximate number of concurrent connections to the server]
[Decision Support(DSS)/OLAP]-併發數20
[Online Transaction Processing(OLTP)]-併發數500
[Manual Setting]-併發數自定義
#選擇[Manual Setting], Concurrent connections[100]
#單擊[Next>]
3.9.5> [網絡選項]Please set the networking options
[Enable TCP/IP Networking]-啓用TCP/IP網絡
[PortNumber:[3306]]-端口
[Add firewall exception for this port]-添加到防火牆例外
[Enable Strict Mode]-啓用嚴格模式
#選擇默認[Next>]
3.9.6> [選擇字符集]Please select the default character set.
[Standard Character set]-默認Latine 適用於英文或其它西歐語言
[Best Support For Multilingualism]-支持多種語言
[Manual Selected Default Character Set/Collation]-自定義
#選擇[Best Support For Multilinguatilsm]
#單擊[Next>]
3.9.7> 設置Windows選項[Please set the Windows options]
[Install As Windows Service[安裝爲windows服務]
[Launch the MySQL Server automatically[自啓動]
[Include Bin Directory in Windows PATH[加入環境變量]
#選擇默認
#單擊[Next>]
3.9.8> 設置安全選項[Please set the security options]
[Current root password]-舊密碼,留空
[New root password]-新密碼,
[Confirm]-確認新密碼
[Enable root access from remote machines]-啓用root帳號遠程訪問
[Create An Anonymous Account]-創建匿名帳號
#輸入密碼和確認密碼, 其它默認
#單擊[Next>]
3.9.9> 準備執行[Ready to execute...]
#單擊[Execute]
3.9.10> Processing configureation...
#單擊[Finish]
----------------------------------------------------------------------------
4> 【phpMyAdmin】
4.1> 將phpMyAdmin-3.3.9-all-languages.zip解壓到[D:/lamp/sites/phpmyadmin/]
----------------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++
【apache配置】
5.1> httpd.conf(D:/lamp/apache2.2/conf)
5.1.1> #功能: 加載php模塊
#說明: 搜索LoadModule, 在其後面添加
LoadModule php5_module "D:/lamp/php/php5apache2_2.dll"
5.1.2> #功能: 設置工作目錄
#說明: 搜索DocumentRoot, 修改爲
DocumentRoot "D:/lamp/sites"
5.1.3> #功能: 設置目錄選項
#說明: 搜索<Directory "D:/lamp/apache2.2/htdocs">, 修改爲
<Directory "D:/lamp/sites">
5.1.4> #功能: 設置默認文檔
#說明: 搜索<Directory />, 添加
DirectoryIndex index.php index.html
5.1.5> #功能: 增加php類型
#說明: 在文件末尾加入
AddType application/x-httpd-php .html .php
#功能: php.ini所在目錄
#說明: 在文件末尾加入
PHPIniDir "D:/lamp/php"
功能: 不允許訪問目錄
說明: 搜索Options Indexes FollowSymLinks項,並註釋
#Options Indexes FollowSymLinks
5.2> 注意: 修改配置文件後, 重啓apache才能生效
5.3> 在D:/lamp/sites/建立文件
#phpinfo.php
輸入內容:
<?php
phpinfo();
?>
訪問:http://localhost/phpinfo.php
【php配置】
6.1> php.ini
6.1.1> D:/lamp/php/php.ini, 複製php.ini-recommended並重命名爲php.ini
6.1.2> #功能: 指定擴展庫所在目錄
extension_dir = "D:/lamp/php/ext/"
#功能: 開啓擴展
#說明: 根據需要開啓相應擴展模塊, 去掉前面的分號
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_mcrypt.dll
extension=php_mysql.dll
extension=php_mysqli.dll
#功能: 設置時區
#說明: PRC表示中國
date.timezone = PRC
#功能: 顯示錯誤信息
display_errors = On
6.2> 複製libmysql.dll, libmcrypt.dll(D:/lamp/php)到C:/WINDOWS/system32/
6.3> 重啓apache,訪問http://localhost/phpinfo.php,查看相應擴展是否加載成功
++++++++++++++++++++++++++++++++++++++++++++++