Briefly introduce the _php skill of building apache+php+mysql development environment under Win7

Source: Internet
Author: User
Tags memcached php redis redis redis download

Environment Catalog: E:\dev

First, Apache

Download Address: http://www.apachelounge.com/download/

We download the VC11 runtime's

1. Installation Instructions:

Running the Apache installer is very simple, "next" after the installation interface

Then there will be an interface, you need to fill out 3 content, respectively: Network Domain, Server Name, Administrator ' s Email address casually fill in the good, do not affect the content.

There are 2 options below, the default selection is 80 port, the second is 8080 port, according to personal requirements, generally the default 80 ports.

We continue with the installation, select Custom (customized installation)-"Next"

Where there are components with red X, we click this component to select "This feature, and all subfeatures, will is installed on the local hard drive.", that is, this section, and subordinate parts, are all installed locally On the hard drive. " -"Next"

Then select "Change" in the lower right corner to alter the installation path and install the "D:\WAMP\Apache\"-"Next" in the directory you just created.

After installation, the lower right corner of the computer will be an icon, double-click Open, select Start or restart, can run normally, this installation is complete.

2. Modify the configuration:

Open the D:\WAMP\Apache\conf\httpd.conf file (when modifying the configuration file, it is not recommended to use Notepad, it may affect it, it is recommended to use notepad++ or other editing software to open the modification)

After opening ctrl+f Find what you want to modify

Add 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. html

DocumentRoot "E:/wamp/apache/htdocs" 

Modified to (the path here is the same as the Wwwroot directory in IIS, for storing web pages, customizing or not modifying the default): DocumentRoot "D:/wamp/www"

Modify to (custom or do not modify default):

DirectoryIndex index.html

Modified into:directoryindex index.php default.php index.html index.htm default.html

Second, PHP

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

Currently the latest version is the PHP 5.6.11

1. Architecture X86 and X64

2. Safe mode thread safe (thread safety) Non thread safe (non-thread safety)

Apache Select thread Safe,iis select non thread Safe

3, the operation of the library, VC11

I am Win7 64-bit, so choose VC11 x64 Thread Safe (2015-jul-10 06:25:47)

1. Installation Instructions

As we download the ZIP compression package, just extract the file to the "D:\WAMP\PHP" directory

2. Modify Configuration

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

; Extension_dir = "ext"
Modified into:Extension_dir = "E:\WAMP\PHP\ext"

will be 947 lines below these files in front of the ";" Remove
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

;d Ate.timezone =
Modified into (many sites do not mention here to modify, the default for the United States time, if not modified will be an error):date.timezone = Asia/shanghai

Third, MySQL

Installation method:

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

2, decompression installation http://dev.mysql.com/downloads/mysql/

1. Installation Instructions:

Open the installer and click Next
Select Custom, the component is the default selection, we do not make changes-"next"

The path is set to "D:\WAMP\Mysql"-"Next"

After installation, click "Finish"
Then a configuration wizard appears-"Next"

Select "Detailed Configuration (Detailed configuration)"-"Next"

Here are 3 options:

Developer Machine will only use as little memory as possible;
Server Machine, will use a medium amount of memory;
Dedicated MySQL server Machine, this server only runs the MySQL database, will occupy all the memory.

You can choose from your own needs, here we choose the second "Server Machine"-"Next"

There are also 3 options for choosing a database purpose:

Mutltifunctional database multi-purpose Use, will optimize the databases into a very good innodb storage type and efficient MyISAM storage type;
Transactional Database only for transaction processing type, the best optimization innodb, but also support MyISAM;
Non-transactional Databse Only is a non transactional type, suitable for simple applications, and only myisam types that do not support transactions are supported.

The general choice of the first multi-functional, the same we are. -"Next"

Select INNODDB Data storage location, general default on the line, in order to unify I filled out the "wamp/mysql datafiles"-"Next"

Choose the maximum number of connections that MySQL allows, the first is the maximum 20 connection concurrency, the second is the maximum number of 500 concurrent connections, the last one is customized, you can choose according to the requirements, I choose the second-"Next"

The following is the choice of database listening port, the general default is 3306, if you change to other ports, when you connect the database to remember the modified port, otherwise can not connect MySQL database, more trouble, here do not make changes, with mysq default port: 3306-"Next"

This step sets MySQL's default encoding, we select the third, and in the Character set menu, select "GBK" code-"Next"
(Note: If you want to use the original database data, it is best to determine what the original database is encoded, if the code set here and the original database data encoding inconsistent, in the use of the time may appear garbled. )

This step is to set MySQL as Windows, the general choice to set up a service, so that the MySQL database can be started and closed through the service. The following check box is also checked, so that in cmd mode, you do not have to execute commands under MySQL's Bin directory. Which is to put the top and bottom 2 hooks, the middle default-"next"

This step is to set MySQL's superuser password, this super user is very important and has all the rights to MySQL, please set and keep in mind the superuser password, there is a check box is to choose whether to allow remote machine with root user to connect to your MySQL server, if this need, Please also tick. Here we use the default selection to enter the password in new root password and confirm. "Next"

Click "Execute" to configure, a little wait for a while, the tick on the dot all hit, on behalf of the configuration completed.

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.

Four, Memcached

Download Address: http://blog.couchbase.com/memcached-windows-64-bit-pre-release-available

Table of Contents: dev/memcached

Install: Perform E:\dev\memcached\memcached.exe-d install at the command line

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

PHP memcache extended Download: Http://pecl.php.net/package/memcache

php.ini Open Extension Extension=php_memcache.dll

Five, Redis and PHP Redis extensions

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

PHP Redis Extended Download Address: Http://pecl.php.net/package/redis

Put the downloaded php_redis.dll into the extended directory of PHP ext, then open it in php.ini

Six, the end

So far Windows7 under the PHP environment has been built, we enjoy the use of it.

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.