Home > php教程 > php手册 > Build apache+php+mysql running environment locally in win10

Build apache+php+mysql running environment locally in win10

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-21 14:52:58
Original
1391 people have browsed it

First download the required software:

Vc2015: https://www.microsoft.com/zh-CN/download/details.aspx?id=48145

Vc2012: http://www.microsoft.com/zh-CN/download/details.aspx?id=30679

Apache2.4: http://www.apachelounge.com/download

PHP: http://windows.php.net/download (Download the thread-safe version, namely Thread Safe)

Mysql: https://downloads.mariadb.com/archives/mysql-5.5/mysql-5.5.27-win32.msi

Install and configureApache

Apache version: Apache2.4.16

Unzip directory: D:PHPApache24

To install Apache2.4.16, you need to install the Visual C++ Redistributable for Visual Studio 2015 runtime library first

(1). The downloaded file is the decompressed file, decompress it and put it in the location where you want to install it.

(2). Open the httpd.conf file under Apache24conf and modify the following key locations:

ServerRoot “D:/PHP/Apache24” (that is, the installation location of Apache);

DocumentRoot “D:/PHP/Apache24/htdocs” (Apache’s default website root directory, which can be adjusted according to your own preferences)

Options to modify the root directory:

Before modification

<Directory "c:/Apache24/htdocs">
Copy after login
    Options Indexes FollowSymLinks
Copy after login
Copy after login
    AllowOverride null
Copy after login
    Require all granted
Copy after login
Copy after login
</Directory>
Copy after login
Copy after login

After modification

<Directory "D:/PHP/Apache24/htdocs">
Copy after login
    Options Indexes FollowSymLinks
Copy after login
Copy after login
    AllowOverride All
Copy after login
    Require all granted
Copy after login
Copy after login
</Directory>
Copy after login
Copy after login

#ServerName www.example.com:80 => ServerName 127.0.0.1:80 (remove the # in front)

DirectoryIndex index.html => DirectoryIndex index.html index.php index.htm (we added index.php index.htm)

ScriptAlias ​​/cgi-bin/ "c:/Apache24/cgi-bin/" was changed to

ScriptAlias ​​/cgi-bin/ "d:/PHP/Apache24/cgi-bin/"

=>

(3). Open cmd and enter the following command line

d: Enter

cd PHPApache24bin to the bin directory in Apache24

httpd press Enter. If there is no prompt, it means the startup is successful

If you want to add Apache24 to the service, run cmd as administrator and enter the following command

d: Enter

cd PHPApache24bin press enter

httpd.exe -k install press enter

(4). Open the browser and enter "http://localhost/" to test. "It works!" is displayed to prove that the configuration is successful.

Install and configure PHP

PHP version: php5.6.14

Installation directory: D:PHPphp56

To install php5.6.14, you need to install the Visual C++ Redistributable for Visual Studio 2012 runtime library

(1). The downloaded file is the unzipped file, unzip it and put it in the location where you want to install it;

(2). Copy php.ini-development and rename it to php.ini

(3). Let Apache24 load the PHP module, open Apache24confhttpd.conf, and add

at the end

LoadModule php5_module "D:/PHP/php56/php5apache2_4.dll"

AddType application/x-httpd-php .php .html .htm

PHPIniDir "D:/PHP/php56" (tell apache the location of php.ini)

(4). Enable several common php extensions, open the php.ini file, and modify the following content:

;extension_dir = "ext" => extension_dir = "D:/PHP/php56/ext" (remove semicolon)

;extension=php_mbstring.dll => extension=php_mbstring.dll

;extension=php_mysql.dll => extension=php_mysql.dll

;extension=php_mysqli.dll => extension=php_mysqli.dll

Note: To enable curl extension under win, libeay32.dll and ssleay32.dll must be placed in the directory included in the PATH environment variable

(5). Restart the Apache server

InstallMysql

Mysql version: mysql5.6.27

Click the file to install it directly.

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template