转:win7(32/64)+apache2.4+php5.5+mysql5.6 环境搭建配置
首先要有耐心仔细读完全文,尤其是括号里面的注释。 环境:win7 32.(64位的同理,下载相关软件必须是对应的64位版本) 所需软件: 0.安装Apache的前必须安装VC11vcredist_x86.exe(64位请下载vcredist_x64.exe),选择时尽量选择英文版( 因为我在公司64位win7
首先要有耐心仔细读完全文,尤其是括号里面的注释。
环境:win7 32.(64位的同理,下载相关软件必须是对应的64位版本)
所需软件:
0.安装Apache的前必须安装VC11 vcredist_x86.exe (64位请下载vcredist_x64.exe),选择时尽量选择英文版(因为我在公司64位win7上开始安装的是中文版的vc11,安装完后Apache启动异常,重新安装英文版vc11正常。)
1.Apache2.4.9(httpd-2.4.9-win32-VC11.zip) http://www.apachelounge.com/download/ (说明:Apache官方网站没有提供这个版本,在php的win版下载中有这个版本的下载地址)
2.php-5.5.10(php-5.5.10-Win32-VC11-x86.zip),我们这里选择线程安全版(VC11
x86 Thread Safe)。(关于如何选择线程安全与非线程安全,请参阅:Which
version do I choose? 或 选择和下载
PHP 发行包 或 PHP的线程安全与非线程安全版本的区别)
3.MySQL 5.6.16(MySQL Community Server 5.6.16) http://dev.mysql.com/downloads/mysql/
安装
0.安装VC11,若干个下一步就OK;
1.Apache 下载后是zip包,解压到后放在合适的位置就可以了,这里我们将它放在C盘的apache24目录;
2.php 下载后也是zip包,同样解压到合适位置,我们这里也将其放在C盘的php55目录;
3.安装mysql也很简单,若干个Next(官方安装教程:http://dev.mysql.com/doc/refman/5.6/en/mysql-installer-gui.html)
配置
1.将C:\php55\php.ini-production 复制一份,并重命名为php.ini;将C:\php55和C:\php55\ext加入环境变量PATH中;
2.用记事本打开C:\apache24\conf\httpd.conf
修改 37行 ServerRoot "c:/Apache24" => ServerRoot "c:/Apache24"(这里输入的是你解压apache安装包的位置)
修改 217行 #ServerName www.example.com:80 => ServerName www.example.com:80
(去掉前面的#)
修改 241行 DocumentRoot "c:/Apache24/htdocs" => DocumentRoot
"c:/Apache24/htdocs" (这里跟我解压Apache的目录一样,不用改)
修改 242行
修改 275行 DirectoryIndex index.html => DirectoryIndex
index.html index.php index.htm (我们添加了index.php
index.htm)
修改 358行 ScriptAlias /cgi-bin/ "c:/Apache24/cgi-bin/" => ScriptAlias
/cgi-bin/ "c:/Apache24/cgi-bin/" (依然一样不用改)
修改 374行
注意:虽然上述有几项设置不用改,主要是我将apache安装的文件夹设置的跟默认一样,假如你将apache安装到D盘或者其他目录,这些设置都需要跟你安装路径匹配
添加 (在C:\apache24\conf\httpd.conf 最后一行添加)
a.让apache支持php
添加 LoadModule php5_module "c:/php55/php5apache2_4.dll" (请确认c:/php55/有php5apache2_4.dll,如果你下载的是我提供的连接肯定是有的)
添加 AddType application/x-httpd-php .php .html .htm
b.告诉apache php.ini的位置
添加 PHPIniDir "c:/php55"
至此,httpd.conf 配置完成,保存httpd.conf 。
3.将apache安装到系统服务中
在cmd中执行:c:\apache24\bin\httpd -k install
4.开启几个常用php扩展,用记事本打开C:\php55\php.ini
修改 721行 将; extension_dir = "ext" => extension_dir = "ext" (去掉extension前面的分号)
修改 873行 将;extension=php_mbstring.dll => extension=php_mbstring.dll(去掉extension前面的分号,这是php多字节字符串扩展)
修改 875行 将;extension=php_mysql.dll => extension=php_mysql.dll(去掉extension前面的分号)
修改 876行 将;extension=php_mysqli.dll => extension=php_mysqli.dll(去掉extension前面的分号)
启动
启动apache,两种启动方式:1.在windows服务中启动;2.双击c:\apache24\bin\ApacheMonitor.exe启动;
启动mysql,两种启动方式:1.在windows服务中MySQL56启动;2.Mysql Notifier启动。
测试
下面我们测试下环境吧,我们安装最常用的mysql管理工具phpmyadmin测试吧
如果你理解并成功搭建好了这套环境,不用太感激我,记住我的名字叫”雷锋(Samuel)“ .^.^.

Alat AI Hot

Undresser.AI Undress
Apl berkuasa AI untuk mencipta foto bogel yang realistik

AI Clothes Remover
Alat AI dalam talian untuk mengeluarkan pakaian daripada foto.

Undress AI Tool
Gambar buka pakaian secara percuma

Clothoff.io
Penyingkiran pakaian AI

AI Hentai Generator
Menjana ai hentai secara percuma.

Artikel Panas

Alat panas

Notepad++7.3.1
Editor kod yang mudah digunakan dan percuma

SublimeText3 versi Cina
Versi Cina, sangat mudah digunakan

Hantar Studio 13.0.1
Persekitaran pembangunan bersepadu PHP yang berkuasa

Dreamweaver CS6
Alat pembangunan web visual

SublimeText3 versi Mac
Perisian penyuntingan kod peringkat Tuhan (SublimeText3)

Topik panas

Apakah yang perlu saya lakukan jika bar tugas Win7 tidak memaparkan ikon Bagaimana untuk menyelesaikan masalah ikon bar tugas komputer hilang

Bagaimana untuk menambah kelayakan Windows dalam Win7

Bagaimana untuk mengosongkan semua imej latar belakang desktop dalam Win7 Petua untuk memadam imej latar belakang yang diperibadikan dalam Win7?

Di manakah penemuan rangkaian dalam Win7 Petua untuk mendayakan fungsi penemuan rangkaian dalam Win7?

Cara cepat membatalkan kata laluan hidupkan WIN7

Bagaimana untuk memadam virus vbs dalam win7

Pengenalan kepada cara menukar bunyi permulaan komputer Windows 7

Bagaimana untuk mengubah suai animasi but dalam Windows 7
