The construction of APACHE+PHP+MYSQL environment under window and the knowledge involved

Source: Internet
Author: User
Tags install php time zones

One. Install Apache 1. Search online for the following 3 files, and find a place to create a new folder

Folder has: Apache,mysql,php folder, it is best not to have Chinese path

  

HTTPS is encrypted with SSI after the HTTP protocol, more secure!

MSI is Microsoft's installer package!

2. If you install Apache, install the binaries directly (executable files)

If it is a WIN10 operating system, you need to run as an administrator:

Then go to the software installation rhythm

Set up basic information

Then next

3. Select a Custom installation

4. Select the installation path (! All directories can not appear in any Chinese)

5. Installation

What other addresses are available to access other than localhost?

Native IP Address

So the problem comes with this "it works!" "Is it from there?

From the default document root directory

6. Managing Apache

There are several common ways to manage this:

A.apache itself provides an Apache service image Manager

Attention! --"It's not Apache's server software, it's just a manager!" Even exiting does not affect Apache service!

Two. managing in the form of Windows services

By default, Apache is installed as a service for Windows!

Open the Windows Service Manager first:

Three. Installation and management of PHP

Installing PHP is simple, unzip and copy the new PHP directory before you can:

At this point, PHP is just a standalone software that can run on its own and has no relationship with Apache:

Install the environment variables first:

You can then build the PHP file in Apache's Htdocs and run it

Configure PHP

The relationship between first:php and Apache

In general: PHP is the relationship with Apache: PHP is a functional module of Apache, and Apache calls PHP

what is Apache function module?

Apache itself is not very powerful, but it can load a lot of modules to expand its functionality, it can be said that Apache is a lot of modules composed of software! Every Apache module is responsible for completing a specific function!

Apache's function modules are loaded in Apache's configuration file .

First open the main configuration file for PHP:

Many of the Apache modules are loaded into Apache's interior via LoadModule instructions!

We can also use HTTPD-M to see which modules are currently loaded by Apache:

OK, now that you understand the relationship between PHP and Apache, start the following steps

Step one: Install PHP as a functional module of Apache

Load Syntax:

LoadModule Module name ( not optional) The location of the module's dynamic link library ( the loaded path)

Among them, the PHP module name: php5_module, also PHP program code has been stipulated

Module address: In the PHP installation directory, Php5apache2_2.dll

Then restart apache! (because Apache only reads the configuration file when it is started)

However, it is still not successful to run PHP files.

Because, now Apache just loaded PHP module, not to PHP "Assign task"!

The second step: in Apache in the end of PHP files to the PHP module to handle

is to assign a task to PHP.

You also need to restart apache!.

At this point, PHP is part of Apache, so the configuration information of PHP needs to be loaded by Apache!

Step three: Determine and load the PHP configuration file

In theory, the PHP configuration file php.ini can appear in any directory of the computer, that is, in the computer, there may be multiple PHP configuration files, first of all to determine in which directory to load! In order to facilitate management, it is generally placed php.ini in the PHP installation directory!

first, using Apache the configuration directive Phpinidir configuration file path:

then, add php.ini in the appropriate directory :

With existing template modifications, you can:

Production environment is open to the outside world, the development environment is individual learning use

We will copy a template for the configuration file under the development environment and modify it to php.ini:

Restart apache!

Fourth step: Modify the time zone

Error:

Time zones, which are typically the options you must configure!

Now search in Php/php.ini: TimeZone, change the value in timezone to PRC

Because PHP is part of Apache.

So, you need to restart apache!

Four. Installation and configuration of Mysql

Installation:

1. Select a Custom installation

2. Select the installation directory:

You need to configure two directories:

Directory of MySQL Management system

Directory for MySQL Database

3. Installation

Enter the configuration phase:

Configuration phase:

1. Select Detailed Configuration

2. Select the development machine

3. Select the multifunction server

4. Select Low concurrency

5. Turn on Strict mode

Strict mode: When inserting data, the data must be the same as the type of the field. 6. Select the UTF8 character set

7. Install Environment variables

8. Set the root user password

9. The execution configuration takes effect.

(If the card is closed for more than 30 minutes, delete the following files, and then reinstall)

If success is a good luck, eat chicken tonight ·

The construction of APACHE+PHP+MYSQL environment under window and the knowledge involved

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.