A brief introduction to building an apache + php + mysql development environment in win7

Source: Internet
Author: User
Tags php redis
Here we will introduce the detailed steps and steps for building the "PHP + Apache + MySql" website running environment under Win7, which is very detailed and comprehensive. if you need it, you can refer to it. Environment Directory: E: \ dev

I. Apache

: Http://www.apachelounge.com/download/

Download

1. Installation instructions:

Run the apache installer. the method is very simple. after the installation interface is displayed, "next"

Next, an interface is displayed. you need to fill in three items: Network Domain, Server Name, and Administrator's Email Address.

There are two options below. the default value is Port 80 and the second value is port 8080. the default value is port 80.

To continue the installation, choose Custom (Custom installation)-"next"

There is a red X component. click This component and select "This feature, and all subfeatures, will be installed on local hard drive. ", that is," this part and its sub-parts are all installed on the local hard disk ". -"Next"

Select "change" in the lower-right corner to change the installation path and install it in the created directory "D: \ WAMP \ Apache \"-"next"

After the installation is complete, an icon is displayed in the lower right corner of the computer. double-click it and select start or restart to run properly. the installation is complete now.

2. modify the configuration:

Open the installation directory D: \ WAMP \ Apache \ conf \ httpd. conf file (when modifying the configuration file, we do not recommend using Notepad, which may affect it. we recommend using Notepad ++ or other editing software to open the modification)

Press Ctrl + F to find the content to be modified.

Add the following under # LoadModule vhost_alias_module modules/mod_vhost_alias.so:

LoadModule php5_module “D:/WAMP/PHP/php5apache2_2.dll” PHPIniDir “D:/WAMP/PHP” AddType application/x-httpd-php .php AddType application/x-httpd-php .htm AddType application/x-httpd-php .htmlDocumentRoot “E:/WAMP/Apache/htdocs” 

Modify to (the path here is the same as the wwwroot directory in IIS, used to store webpages, customize or do not modify the default): DocumentRoot "D:/WAMP/www"

Modify to (custom or do not modify the default value ):

DirectoryIndex index.html

Changed to DirectoryIndex index. php default. php index.html index.htm default.html default.htm.

II. PHP

: Http://windows.php.net/download

The latest version is PHP 5.6.11.

1. X86 and X64 architectures

2. Thread Safe (Thread security) Non-Thread Safe (Non-Thread security)

Select Thread Safe for apache and Non Thread Safe for IIS.

3. Runtime Library, VC11

I am a 64-bit Windows 7 player, so I chose VC11 x64 Thread Safe (06:25:47)

1. Installation Instructions

Since we downloaded the ZIP package, we only need to extract the file to the "D: \ WAMP \ PHP" directory.

2. modify configuration

Change the D: \ WAMP \ PHP \ php. ini-development file to php. ini.
Open php. ini

; Extension_dir = "ext"
Changed to extension_dir = "E: \ WAMP \ PHP \ ext"

Remove ";" in front of these files in the first row.
Extension = php_curl.dll
Extension = php_gd2.dll
Extension = php_mbstring.dll
Extension = php_mysql.dll
Extension = php_mysqli.dll
Extension = php_pdo_mysql.dll
Extension = php_xmlrpc.dll

; Date. timezone =
Modified to (many websites do not mention the modification here. the default value is US time. if it is not modified, an error will be reported): date. timezone = Asia/Shanghai

III. MySQL

Installation method:

1. msi MSI Installer http://dev.mysql.com/downloads/installer/

2. unzip the installation http://dev.mysql.com/downloads/mysql/

1. Installation instructions:

Open the installer and click "next"
Select custom. the default component is selected. we will not change it-"next"

Path: "D: \ WAMP \ Mysql"-"next"

After installation, click "finish"
A configuration wizard-"next" appears"

Select "Detailed Configuration (Detailed Configuration)"-"next"

There are three options:

Developer Machine, which uses as little memory as possible;
Server Machine, which uses a moderate amount of memory;
Dedicated MySQL Server Machine, which only runs the mysql database and occupies all the memory.

You can choose one as needed. here we choose the second "Server Machine"-"next"

Select the database purpose. There are also three options:

Mutltifunctional Database multi-functional purposes, will optimize the Database into a good innodb storage type and efficient myisam storage type;
Transactional Database is Only used for transaction processing. it is best to optimize innodb, but also supports myisam;
Non-Transactional Databse Only is a Non-transaction processing type and is suitable for simple applications. Only the myisam type that does not support transactions is supported.

Generally, we choose the first type of function. -"Next"

Select the data storage location of InnodDB, which is generally the default. to ensure consistency, I entered "WAMP/MySQL Datafiles"-"next"

Select the maximum number of connections allowed by mysql. The first is the maximum number of 20 connections, the second is the maximum number of 500 concurrent connections, and the last is custom. you can select the number as needed, select the second-"next"

The following is the port for database listening. the default port is 3306. if it is changed to another port, remember the modified port when connecting to the database. Otherwise, you cannot connect to the mysql database, which is troublesome, do not modify it here. use the default port of mysq: 3306-"next"

In this step, Set the default mysql encoding. we select the third encoding. in the Character Set menu, select "gbk" encoding-"next"
(Note: If you want to use the data of the original database, it is best to determine the encoding used by the original database. if the encoding set here is inconsistent with the encoding of the original database data, garbled characters may occur during use .)

This step is whether to set mysql to windows. Generally, you can set it to a service so that you can enable and disable mysql databases through the service. The check boxes below are also checked. In cmd mode, you do not have to execute commands in the bin directory of mysql. That is, the upper and lower two hooks are marked, and the Middle default is-"next"

This step is to set the mysql super user password. this super user is very important and has all permissions for mysql. please set and remember the super user password, the following check box is used to select whether to allow remote machines to connect to your mysql server as the root user. if you need this check box, check it. Here we use the default option, and enter the password in New root password and Confirm. "Next"

Click "execute" for configuration. wait a moment and check all the dots to complete the configuration.

2. modify the configuration:

Open D: \ WAMP \ MySQL \ my. ini
Set datadir to D:/WAMP/MySQL/data/or the directory where you want to store the data.

IV. Memcached

: Http://blog.couchbase.com/memcached-windows-64-bit-pre-release-available

Directory: dev/memcached

Install: execute E: \ dev \ memcached \ memcached.exe-d install on the command line

Start: E: \ dev \ memcached \ memcached.exe-d start

Php memcache extension Download: http://pecl.php.net/package/memcache

Php. ini enable extended extension = php_memcache.dll

V. Redis and PHP redis extension

Redis: https://github.com/MSOpenTech/redis/releases

Php redis extension: http://pecl.php.net/package/redis

Put the downloaded php_redis.dll to the extension directory ext of php, and enable it in php. ini.

6. end

So far, the PHP environment in Windows 7 has been set up.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.