Construction of PHP7 (64-bit) operation procedure in WIN7 environment

Source: Internet
Author: User
Tags phpinfo dedicated server

Construction of PHP7 (64-bit) operation procedure in WIN7 environment

I. Installing and configuring Apache


1. Download Apache
: https://www.apachelounge.com/download/

2. Installing Apache
A, unzip the package to D:\ Directory, and is named Apache24;

B. Start the Windows command line and switch to the bin subdirectory in the Apache installation directory;

such as:d:\apache24\bin>

C, the installation of Httpd.exe as a Windows system services;

Example: D:\apache24\bin>httpd-k Install

The system prompts as follows:
This program cannot be started because there is something missing in the computer-try reinstalling ....
Cause of error: Need vc++2015

D. Download vc++2015 and install

: https://www.microsoft.com/zh-cn/download/confirmation.aspx?id=48145
After the installation is successful, you can view it in the Control Panel:

E, try the third step again, the result is as follows:

The "Apache2.4" service is successfully installed
Indicates that the installation was successful
There's a errors AH00558 down there, no matter what.

F, open the Apache configuration file httpd.conf, search define Srvroot (only one place), and enclose the path in the double quotation marks behind it
After the actual decompression path to Apache is saved,

such as: Define srvroot "D:\Apache"

G, start Apache

D:\apache24\bin>httpd-k start
Or
D:\apache24\bin>net Start apache2.4

H, start the browser, and then enter http://127.0.0.1 to see the effect of the operation:

Will run D:\Apache24\htdocs the index.html file under this folder is right.

(This directory is the default read home directory, later can be modified to the directory you want to read)

I, uninstall Apache
Before uninstalling, to stop Apache
D:\apache24\bin>net Stop apache2.4

To uninstall again
D:\apache24\bin>httpd.exe-k Uninstall-n Apache2.4



Second, install and configure PHP


1. Download PHP
: Http://windows.php.net/download

2. Install PHP
A, unzip the package into the D:\ directory, and named php7.0;

B, PHP configuration file origin
Duplicate a copy of the Php.ini-production file (prevent the post-configuration file from changing to a bad original)
and renamed to PHP.ini, this file is the PHP configuration file;

Third, bind PHP to Apache
A. Edit the Apache configuration file httpd.conf (located in the Conf subdirectory of the Apache installation directory);
Add the following statement
#加载php7这个Apache模块, D:\php7.0 is the PHP decompression path, followed by the module name
LoadModule php7_module "D:\php7.0\php7apache2_4.dll"

#加载php the. ini configuration file, give the path
Phpinidir "D:\php7.0"

#添加. php files to Apache parsing
AddType application/x-httpd-php. php

B. Modify the default read home directory for Apache
Edit the Apache configuration file httpd.conf,
Search for DocumentRoot and Directory options after opening (two options are not far away)
Change the path in the quotation marks to the directory you want Apache to read by default.
Such as:
DocumentRoot "D:\WWW"
<directory "D:\WWW" >

C, edit the DirectoryIndex option, you can modify the default home page of Apache (multiple file names separated by a space);
Such as:
<ifmodule dir_module>
DirectoryIndex index.html index.php a.php b.php l.php
</IfModule>
If you do not want to modify, then do not bother!!

D, after saving the settings, restart Apache;

E, in the home directory that Apache reads by default, create a PHP file,
such as index.php, and edit phpinfo () in this file;
Then go to the page to run this file to see if the PHP file is installed successfully
If the page does not move, press CRTL+F5 to force the refresh

<?php
Phpinfo ();

Iv. installation of MySQL

1. Download MySQL

: http://dev.mysql.com/downloads/mysql/

2. Install MySQL

A, unzip the package into the D:\ directory, and named MySQL5.7;

B, the origin of the MySQL configuration file
Copy My-default.ini This file and rename it to My.ini; (prevent the post-configuration file from changing the original.)

C, edit the My.ini, configured as follows:
[MySQL]
Default-character-set=utf8
[Mysqld]
# Remove Leading # and set to the amount of RAM for the most important data
# Cache in MySQL. Start at 70% of all RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove Leading # to turn on a very important data integrity option:logging
# Changes to the binary log between backups.
# Log_bin
# These is commonly set, remove the # and set as required.

#这里的路径, the actual decompression path for MySQL
Basedir = D:\MySQL5.7
DataDir = D:\MySQL5.7\data
Port = 3306
Max_connections = 200
Character-set-server = UTF8
Default-storage-engine = INNODB
#最后一行千万不能删除
Sql_mode=no_engine_substitution,strict_trans_tables

D. Start the Windows command line, and switch to the D:\MySQL5.7\bin subdirectory, and then enter:

D:\mysql5.7\bin>mysqld--initialize-insecure--user=mysql

After executing the above command, MySQL automatically creates the data folder, and the default database is built, the login user name is root, the password is empty;

E. Install Database command

D:\mysql5.7\bin>mysqld.exe-install

F, the last input net start MySQL startup service;

G, re-open a cmd window, enter mysql-uroot-p
There might be something that's not internal or external command what the Devil
How to resolve:
Copy the bin directory of MySQL and append it to the PATH environment variable of your computer.
Remember, it is appended, preceded by a number, plus the path, OK

such as:; Xxxxx;d:\mysql5.7\bin

H: Re-open a cmd window again,
Enter MYSQL-UROOT-P carriage return
No password

I: Set the password, enter the database, hit the following code OH
Set password for ' root ' @ ' localhost ' =password (' root ');

J: Uninstalling the database
Mysqld-remove

Construction of PHP7 (64-bit) operation procedure in WIN7 environment

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.