转: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)“ .^.^.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Recently, many users using Win7 system have found that the icons in the taskbar suddenly disappeared, which makes the operation very inconvenient and they do not know how to solve the problem. This article will introduce to you how to solve the problem of disappearing taskbar icons in Win7 system. Bar! Cause Analysis When encountering such a situation, there are generally two situations: one is that the taskbar on the computer does not really disappear, but is just hidden, and the other is that the taskbar does disappear. Method 1: 1. There is a situation that you need to confirm first, that is, when the mouse is placed at the bottom of the screen, the taskbar will be displayed. You can directly click the mouse on the taskbar and select "Properties". 2. In the dialog box that opens, click & on the "Hide taskbar" option.

In Win7 system, many users want to delete personalized desktop background images, but do not know how to delete them. This article will show you how to delete personalized background images in Win7 system. 1. First, open the control panel interface of the Win7 system and click to enter the "Appearance and Personalization" settings; 2. Then, in the opened interface, click the "Change Desktop Background" setting; 3. Then, click below "Desktop background" option; 4. Then, select Select all, and then click Clear all. Of course, you can also use it under "Customize", right-click the theme you want to delete, and then click &q on the shortcut menu

Many computer users know that network discovery is a network setting. This setting will affect whether the computer can find other computers and devices on the network and whether it can find the computer when other computers on the network are found. So how to enable network discovery in win7? The following computer System Home U Disk Installation will introduce you to the tutorial on how to enable network discovery in win7 system. 1. First, click the "Start Menu" icon on the desktop taskbar and choose to open the "Control Panel" interface. 2. Then, in the interface that opens, set "View by" to "Category", and then choose to enter "Network and Internet"

1. First, select the Control Panel option in the Start button of the Win7 system. 2. Then in the control panel that pops up, click the [User Accounts and Family Safety] item. 3. Then click [Credential Manager] in the pop-up interface. 4. Finally, click [Add Windows Credentials] to create your credentials. The operation method of adding and managing windows credentials in win7 is shared here in detail with friends. More exciting tutorials are available on the PHP Chinese website!

1. First copy the file you want to use as boot music to the corresponding directory of C: WindowsMedia. As shown in the figure: 2. Right-click the desktop on a single machine and select Personalize menu; as shown in the figure: 3. Select the sound option; as shown in the figure: 4. In the [Program Events] box in the [Sound] tab of the sound interface Select [Windows Login], then click [Browse]; as shown in the figure: 5. Select the music file that needs to be replaced, click Open, then click Apply and confirm to save the settings. as the picture shows:

1. Press and hold the [Win+R] keys to open the run dialog box, enter [regedit] in the search box, and then confirm; as shown in the figure: 2. Open HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionAuthenticationLogonUIBackgroud in the opened registry editor; as shown in the figure Display: 3. Double-click [OEMBackground] and open it, change the default value [0] to [1], and then confirm to exit; as shown in the figure: 4. Rename the image backgroundDefault.jpg, (the image size cannot exceed 256k

1. Click [Start → Run] and enter gpedit.msc. On the left side of the [Group Policy] window, click the [Computer Configuration → Windows Settings → Security Settings → Software Restriction Policy] item, and then click the [Action → Create New Policy] menu item. As shown in the picture: 2. Select [Other Rules] from the left. Right-click the blank space in the right pane and select the [New Path Rule] item in the menu. In the pop-up window, click the [Browse] button after [Path], select the wscript.exe file in the C: WindowsSystem32 folder, and set the [Security Level] to [Not Allowed]. Change C: System32, Dllcache and I386 under Windows

1. Press win+r to enter the run window, enter [controluserpasswords2] and press Enter. 2. In the user account window, uncheck [To use this machine, the user must enter a username and password (E)], and then click [Apply → OK].
