This article briefly introduces how to build an apache + php + mysql development environment in win7, win7apache

Source: Internet
Author: User
Tags php redis

This article briefly introduces how to build an apache + php + mysql development environment in win7, win7apache

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.