2010-06-24

apache_x64+php_x64+mysql_x64 安裝筆記

Install 64bit versions of Apache, PHP and MySQL on Windows 7 64bit

2010-06-24 by leeyc

下載 Apache x64 from blackdot.be:
下載網址: http://www.blackdot.be/?inc=apache/binaries
下載檔案: httpd-2.2.15-win64.rar

下載 PHP x64 from fusionxlan.com:
下載網址: http://www.fusionxlan.com/PHPx64.php
下載檔案: php-5.2.8-x64.zip

下載 MySQL 64bit binaries for Windows:
下載網址: http://dev.mysql.com/downloads/mysql/
下載檔案: mysql-essential-5.1.48-winx64.msi
下載工具: mysql-gui-tools-5.0-r17-win32.msi

解壓縮 Apache 64bit
安裝目錄: C:/apache64 <== 解壓縮後 更改目錄名稱
編輯: C:/apache64/conf/httpd.conf 設定檔案

ServerRoot "C:/apache64"
ServerName localhost:80
DocumentRoot "C:/apache64/htdocs"
<Directory "C:/apache64/htdocs">
DirectoryIndex index.html index.htm index.php
ScriptAlias /cgi-bin/ "C:/apache64/cgi-bin/"

如果要設定 virtual hosts 把下面這一行 前面 # 號拿掉
#Include conf/extra/httpd-vhosts.conf

LoadModule rewrite_module modules/mod_rewrite.so

在開始-->執行-->輸入 cmd 開啟 DOS 視窗
cd \Apache64
bin\httpd.exe -k install <== 安裝 Apache 服務
bin\httpd.exe -k start <== 啟動 Apache

可以到 C:\Apache64\bin 執行 ApacheMonitor.exe 啟動快捷圖示

解壓縮 PHP 64bit
安裝目錄: C:/php5
編輯: C:/apache64/conf/httpd.conf 設定檔案
加入以下三行
LoadModule php5_module "C:/php5/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/php"

你一定要把以下檔案 copy 到 (C:/Windows/system32) 不然 php 無法連入 mysql, 在Win7 把C:\php5 加入 path 系統路徑是沒用的
C:/php5/php5ts.dll
C:/php5/libmcrypt.dll
C:/php5/php5apache2_2.dll
C:/php5/libmysql.dll

編輯 C:\php5\php.ini
extension_dir = "C:/php5/ext/"
allow_url_fopen = Off
把需要用到的模組 前面 "#" 移除:
extension=php_gd2.dll
extension=php_mysql.dll
extension=php_oci8.dll (if you have Oracle database installed)
extension=php_pgsql.dll (if you have postgre database installed)
extension=php_zip.dll
extension=php_eaccelerator.dll

[eAccelerator]
;zend_extension_ts=eAccelerator095_5.2.0.dll
eaccelerator.shm_size="64"
eaccelerator.cache_dir="C:/php5/eAccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.debug="0"
eaccelerator.check_mtime="1"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
eaccelerator.keys="shm_and_disk"
eaccelerator.sessions="shm_and_disk"
eaccelerator.content="shm_and_disk"

Set sendmail from e-mail address:
sendmail_from = me@example.com

Some settings for MySQL:
mysql.default_port = 3306
mysql.default_host = localhost

Set the session save path to a writable (by anyone) folder in your computer. You can set this to any existing path you wish (For example C:/tmp).
session.save_path = "C:/tmp"

重啟 Apache 測試 PHP 是不是正常.

安裝 mysql-essential-5.1.48-winx64.msi
安裝 mysql-gui-tools-5.0-r17-win32.msi
安裝完成後 測試 連入看看


下載檔案: phpMyAdmin-3.3.3-all-languages.zip
如果 phpMyAdmin 都可以正常執行 就都安裝OK囉

by leeyc 2010-06-24

沒有留言: