Win7 (64-bit) php5.6-apache2.4-mysql5.6 environment installation

Source: Internet
Author: User

Recently in the study of PHP, yesterday the whole afternoon of the environment, write a blog to share.

installation files:

    1. php-5.6.2-win32-vc11-x64.zip:http://windows.php.net/download/
    2. httpd-2.4.10-win64-vc11.zip:http://www.apachelounge.com/download/
    3. mysql-5.6.16-winx64.zip:http://dev.mysql.com/downloads/mysql/

1, unzip the downloaded installation package:Httpd-2.4.10-win64-vc11.zip put it in their own installation directory (my directory E:\phpEnv\Apache24);

(1) Modify the root path of the ServerRoot Apache:

(37 lines)ServerRoot "C:/apache24"Change to = =ServerRoot "E:/phpenv/apache24

(2) modify servername your host name:

(217 lines) ServerName www.example.com:80 to remove the previous #, this property needs to be used when launching Apache from the command line

(3) modify DocumentRoot Apache access to the Home folder directory (that is, the location of PHP, HTML code files):

Apache default path is under Htdocs (E:\phpEnv\Apache24\htdocs), there will be a simple entry file index.html

This path can be modified on its own, I will configure it in my own new folder www (E:\phpEnv\www)

(242 lines)DocumentRoot "C:/apache24/htdocs"Change to =DocumentRoot "E:\phpEnv\www"(243 lines)<directory "C:/apache24/htdocs" >Change to =<directory "E:\phpEnv\www" >

(4) Modify the Portal file configuration:

DirectoryIndex generally we are index.php, index.html, index.htm as the portal of the Web project

Apache Default portal only index.html need to add the other two support, of course, the entrance file settings can be increased or decreased according to their own needs

If the requirements are more stringent, you can write only one index.php, so that the entry in the project can only be index.php

(275 lines)<IfModuledir_module>Directoryindexindex.html</IfModule>Change to =<IfModuledir_module>DirectoryIndex index.php index.htm index.html</IfModule>

(5) set the Serverscript directory:

(359 lines)scriptalias/cgi-bin/"c:/apache24/cgi-bin/"Change to =scriptalias/cgi-bin/"E:/phpenv/apache24/cgi-bin"

(6)

(375 lines)<directory "C:/apache24/cgi-bin" >AllowOverride NoneOptions NoneRequire all granted</Directory>Change to =<directory "E:/phpenv/apache24/cgi-bin" >AllowOverride NoneOptions NoneRequire all granted</Directory>

3, the next can launch Apache;

Start and run, enter CMD, and open a command prompt. Then enter the E:\phpEnv\Apache24\bin directory httpd Enter,:

You can test without an error (Keep the command window open)

Put the index.html in the E:\phpEnv\Apache24\htdocs directory under the E:\phpEnv\www directory.

Using a browser to access the "It works" will show that Apache has been properly installed and started

You can also write a simple index.html file on your own to open

4. Add Apache to the window service startup and set it to boot;

Close the HTTPD service first (Close the command window)

Reopen a new command window into the D:\phpEnv\Apache24\bin directory:

The command to add the HTTP service is: Httpd.exe-kinstall-n "ServiceName" ServiceName is the name of the service

I added: httpd.exe-k install-n "Apache24" command succeeds after successful prompt

At this point you can see the Apache24 Service in the Window service startup item

Then click on to start, if you do not want to set up the boot, you can also modify the startup type to Manual

Note: If you want to uninstall this service, please stop this service and enter Httpd.exe-k uninstall-n "Apache24" to uninstall this service.

Of course, you can also start Apache by E:\phpEnv\Apache24\bin the ApacheMonitor.exe below.

So the Apache configuration is basically done.

    • Installation configuration php5.6.2 (Php-5.6.2-win32-vc11-x64.zip)

1, the download php-5.6.2-win32-vc11-x64.zip extracted to the installation directory of my is (E:\phpEnv\php);

2. Copy the Php.ini-development file under the directory and rename it to php.ini. He is a PHP configuration file;

3, add PHP support for Apache service;

Open Apache configuration file http.conf at the end of the add

# PHP5 SupportLoadModule Php5_module E:/phpenv/php/php5apache2_4.dllAddType application/x-httpd-php. php. html. htm# Configure Thepath to PHP.iniPhpinidir "e:/phpenv/php"

When adding loadmodule, be careful to ensure that the Php5apache2_4.dll file does exist php5.6.2 inside

There is no such file in the previous version, but the high-point version has already, you can open the PHP installation directory to find this file

Phpinidir "e:/phpenv/php" This is your PHP root directory.

4, restart the Apache server;

5. Testing;

Delete other files in www, create a new index.php, the content is <?php phpinfo ();?> Save, access the information that appears in PHP indicates that PHP has been installed successfully

    • Installation configuration mysql5.6.16 (Mysql-5.6.16-winx64.zip)

1. Install MySQL

64-bit MySQL temporarily did not find the MSI installation package, so extract directly into the installation directory, and then configure the relevant environment variables, modify the configuration file, Add window service on the line

Here is a reference to my configuration file:

[Mysqld]Loose-default-character-set = UTF8Basedir = d:/program/mysql-5.6DataDir = D:/program/mysql-5.6/dataPort = 3306Sql_mode=no_engine_substitution,strict_trans_tablesCharacter_set_server = UTF8[Client]Loose-default-character-set = UTF8

Note: Basedir is the root directory of MySQL, DataDir is the data storage directory of MySQL

After installing MySQL, there is no graphical user interface, you can install a navicat for MySQL and other software, it will look more convenient.

2, after the installation of MySQL, add MySQL support for PHP

Open PHP configuration file php.ini (D:\phpEnv\php\php.ini)

(1) (721 lines); Extension_dir = "ext", remove the front ";" and change to Extension_dir = "D:\phpEnv\php\ext" to open PHP extension support

(2) then the MySQL extension that opens PHP

(875, 876 lines) remove the front ";"

Extension=php_mysql.dll

Extension=php_mysqli.dll

Of course you can also open 881 lines of Php_pdo_mysql.dll enable PHP PDO support

Note: There are many expansion options in lines No. 863 through No. 888, what you need to use, and remove the previous ";" You can do it.

Of course if you want to add additional extension support such as Redis support, PHP itself may not provide the corresponding DLL files, you need to find the appropriate version of the DLL to add to the Ext folder, and then add a extension= in the configuration file ...

When you are finished, restart Apache

    • Summary

Installation is not cumbersome, need to modify the configuration more, it is recommended to manually configure, do not download the integration package, because the PHP version upgrade, to upgrade the integration package PHP is very troublesome

    • Precautions

Install the computer to support VC11

The number of profile lines involved may vary slightly depending on the version or individual changes

Port conflict, the default port in httpd.conf configuration is 80, because it is the default, easy to conflict with other software, such as IIS, the installation process suggested modifying the port, a total of two places need to be modified

(58 lines) Listen 80 to Listen 8001 (218 lines) ServerName www.example.com:80 to ServerName www.example.com:8001

Win7 (64-bit) php5.6-apache2.4-mysql5.6 environment installation

Related Article

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.