Windows下LAMP環境搭建

來源:互聯網
上載者:User

++++++++++++++++++++++++++++++++++++++++++++++
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(e.g.webmaster@somenet.com): [helloworld@helloworld.com]
   #選擇(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]-啟用strict 模式
    #選擇預設[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,查看相應擴充是否載入成功
++++++++++++++++++++++++++++++++++++++++++++++

 

原文:http://blog.csdn.net/ihelloworld/article/details/6127525

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.