Table of Contents
PHP5.5.15+Apache2.4.10+MySQL5.6.20配置方法分享,apache2.4php5.6
Home php教程 php手册 PHP5.5.15+Apache2.4.10+MySQL5.6.20配置方法分享,apache2.4php5.6

PHP5.5.15+Apache2.4.10+MySQL5.6.20配置方法分享,apache2.4php5.6

Jun 13, 2016 am 08:41 AM
apache mysql php php5

PHP5.5.15+Apache2.4.10+MySQL5.6.20配置方法分享,apache2.4php5.6

对于学习php的新手,由于网上的配置方法都是很久之前的,及时性不高,环境配置往往令人很头疼,我初学php配置环境时配置了3个晚上,每次总是会出现这样或那样的问题,如今把最新版的PHP5.5.15+Apache2.4.10+MySQL5.6.20,win7x86的配置方法分享给大家,64位的同理,不过下载的软件需要也是64位的。

环境:win7 32.(64位的同理,下载相关软件必须是对应的64位版本)

             PHP5.5.15(php-5.5.15-Win32-VC11-x86.zip)

             Apache2.4.10(httpd-2.4.10-win32-VC11.zip)

             MySQL5.6.20(mysql-5.6.20-win32.zip)

方法/步骤1:准备(下载所需软件)

安装apache前必须先安装VC11(VSU_4\vcredist_x86.exe),网址为http://www.microsoft.com/en-us/download/details.aspx?id=30679,选择时选择英文版的,如果win7系统是64位的请下载VSU_4\vcredist_x64.exe,下载页面参看下图

Apache2.4.10(httpd-2.4.10-win32-VC11.zip)网址:http://www.apachelounge.com/download/

PHP5.5.15(php-5.5.15-Win32-VC11-x86.zip)这里我们选择的是线程安全版,关于线程安全版与非线程安全版的区别可自行上网查阅相关资料,下载网址:http://windows.php.net/download/,VC11 x86 Thread Safe为32位的线程安全版

MySQL5.6.20(mysql-5.6.20-win32.zip),网址:http://dev.mysql.com/downloads/mysql/,此处选择的为免安装版,参看下图

方法/步骤2:安装

安装VC11,双击打开,点击若干个下一步直至安装成功就OK了

Apache下载后是zip包,解压到后放在合适的位置就可以了,不建议放在C盘里,因为重装系统C盘的数据会全部丢失,这里我们将它放在F盘的phptools文件夹下的apache2.4目录下

php下载后也是zip包,同样解压到合适位置,我们这里也将其放在F盘的phptools文件夹下的php5.5目录下

MySQL选择的是免安装版的,就更简单了,同样是解压到合适的位置,这里我们也将其放在F盘的phptools文件夹下的MySQL目录下,解压安装后如下图

方法/步骤3:配置PHP

1、将F:\phptools\php5.5\php.ini-production 复制一份,并重命名为php.ini;
2、将 F:\phptools\php5.5和F:\phptools\php5.5\ext加入环境变量PATH中,选中计算机,右键属性-->高级系 统设置 -->环境变量-->系统变量,找到Path,编辑,在其后加上;F:\phptools\php5.5;F:\phptools \php5.5\ext,如下图,

方法/步骤4:配置Apache
1、用记事本打开F:\phptools\Apache2.4\Apache24\conf
查找ServerRoot,修改ServerRoot "C:/Apache24" => ServerRoot "F:/phptools/Apache2.4/Apache24"(这里输入的是你解压apache安装包后放的位置)
2、查找#ServerName www.example.com:80 ,修改为 ServerName www.example.com:80 (去掉前面的#)
3、查找DocumentRoot "c:/Apache24/htdocs" , 修改为DocumentRoot "F:/phptools/Apache2.4/Apache24/htdocs" (如果一样,就不用改)
4、查找 ,修改为 (如果一样,就不用改)
5、查找DirectoryIndex index.html ,修改为 DirectoryIndex index.html index.php index.htm (这里我们添加了index.php index.htm)
6、查找ScriptAlias /cgi-bin/ "c:/Apache24/cgi-bin/"  ,修改为 ScriptAlias /cgi- bin/ " F:/phptools/Apache2.4/Apache24/cgi-bin" (如果一样,也不用改)
7、查找 修改为   (如果一样,也不用改)
8、在 F:\phptools\apache2.4.10\conf\httpd.conf最后一行添加添 加 LoadModule php5_module "F:/phptools/php5.5/php5apache2_4.dll" 让 apache 支持php (请确认F:/phptools/ php5.5/有php5apache2_4.dll,如果你下载的是我提供的连接肯定是有的)
9、添加 AddType application/x-httpd-php .php .html .htm
10、添加 PHPIniDir "F:/phptools/php5.5" (告诉apache php.ini的位置)
至此,httpd.conf 配置完成,保存httpd.conf 。


方法/步骤5:将apache安装到系统服务中
输入F:\phptools\Apache2.4\Apache24\bin\httpd -k install,回车
安装过程如下图所示

方法/步骤6:开启几个常用php扩展
1、用记事本打开F:\phptools\php5.5\php.ini
将; extension_dir = "ext"修改为 extension_dir = "ext" (去掉extension前面的分号)
2、将;extension=php_mbstring.dll 修改为 extension=php_mbstring.dll(去掉extension前面的分号,这是php多字节字符串扩展)
3、将;extension=php_mysql.dll修改为 extension=php_mysql.dll(去掉extension前面的分号)
4、将;extension=php_mysqli.dll 修改为 extension=php_mysqli.dll(去掉extension前面的分号)

方法/步骤7:启动Apache
1、MySQL免安装版环境配置,具体请参考:MySQL5.6免安装版环境配置图文教程
2、启动apache,有两种启动方式:
在windows服务中启动;点击开始,找到计算机,右键-->管理-->服务和应用程序-->服务,找到Apache2.4,右键启动即可,如下图


3、双击F:\phptools\Apache2.4\Apache24\bin\ApacheMonitor.exe启动,如下图

方法/步骤8:启动MySQL
MySQL免安装版配置成功后,也在服务中启动,启动方法与Apache在服务中启动方式类似,所不同的是,你点击右键启动的是MySQL服务

注意事项
1)、配置Apache时,配置的目录要与你解压放置的目录一致,否则会出错
2)、启动Apache前要先在windows里安装成功才能启动
3)、MySQL免安装版必须要先配置成功后才能启动

最新php环境搭建成功,谢谢大家的阅读。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1667
14
PHP Tutorial
1273
29
C# Tutorial
1255
24
Steps to add and delete fields to MySQL tables Steps to add and delete fields to MySQL tables Apr 29, 2025 pm 04:15 PM

In MySQL, add fields using ALTERTABLEtable_nameADDCOLUMNnew_columnVARCHAR(255)AFTERexisting_column, delete fields using ALTERTABLEtable_nameDROPCOLUMNcolumn_to_drop. When adding fields, you need to specify a location to optimize query performance and data structure; before deleting fields, you need to confirm that the operation is irreversible; modifying table structure using online DDL, backup data, test environment, and low-load time periods is performance optimization and best practice.

What is the significance of the session_start() function? What is the significance of the session_start() function? May 03, 2025 am 12:18 AM

session_start()iscrucialinPHPformanagingusersessions.1)Itinitiatesanewsessionifnoneexists,2)resumesanexistingsession,and3)setsasessioncookieforcontinuityacrossrequests,enablingapplicationslikeuserauthenticationandpersonalizedcontent.

How to uninstall MySQL and clean residual files How to uninstall MySQL and clean residual files Apr 29, 2025 pm 04:03 PM

To safely and thoroughly uninstall MySQL and clean all residual files, follow the following steps: 1. Stop MySQL service; 2. Uninstall MySQL packages; 3. Clean configuration files and data directories; 4. Verify that the uninstallation is thorough.

An efficient way to batch insert data in MySQL An efficient way to batch insert data in MySQL Apr 29, 2025 pm 04:18 PM

Efficient methods for batch inserting data in MySQL include: 1. Using INSERTINTO...VALUES syntax, 2. Using LOADDATAINFILE command, 3. Using transaction processing, 4. Adjust batch size, 5. Disable indexing, 6. Using INSERTIGNORE or INSERT...ONDUPLICATEKEYUPDATE, these methods can significantly improve database operation efficiency.

How to use MySQL functions for data processing and calculation How to use MySQL functions for data processing and calculation Apr 29, 2025 pm 04:21 PM

MySQL functions can be used for data processing and calculation. 1. Basic usage includes string processing, date calculation and mathematical operations. 2. Advanced usage involves combining multiple functions to implement complex operations. 3. Performance optimization requires avoiding the use of functions in the WHERE clause and using GROUPBY and temporary tables.

Detailed explanation of the installation steps of MySQL on macOS system Detailed explanation of the installation steps of MySQL on macOS system Apr 29, 2025 pm 03:36 PM

Installing MySQL on macOS can be achieved through the following steps: 1. Install Homebrew, using the command /bin/bash-c"$(curl-fsSLhttps://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)". 2. Update Homebrew and use brewupdate. 3. Install MySQL and use brewinstallmysql. 4. Start MySQL service and use brewservicesstartmysql. After installation, you can use mysql-u

How to configure the character set and collation rules of MySQL How to configure the character set and collation rules of MySQL Apr 29, 2025 pm 04:06 PM

Methods for configuring character sets and collations in MySQL include: 1. Setting the character sets and collations at the server level: SETNAMES'utf8'; SETCHARACTERSETutf8; SETCOLLATION_CONNECTION='utf8_general_ci'; 2. Create a database that uses specific character sets and collations: CREATEDATABASEexample_dbCHARACTERSETutf8COLLATEutf8_general_ci; 3. Specify character sets and collations when creating a table: CREATETABLEexample_table(idINT

How to analyze the execution plan of MySQL query How to analyze the execution plan of MySQL query Apr 29, 2025 pm 04:12 PM

Use the EXPLAIN command to analyze the execution plan of MySQL queries. 1. The EXPLAIN command displays the execution plan of the query to help find performance bottlenecks. 2. The execution plan includes fields such as id, select_type, table, type, possible_keys, key, key_len, ref, rows and Extra. 3. According to the execution plan, you can optimize queries by adding indexes, avoiding full table scans, optimizing JOIN operations, and using overlay indexes.

See all articles