Home >Backend Development >PHP Tutorial >Apache+php+mysql environment configuration method under windows

Apache+php+mysql environment configuration method under windows

WBOY
WBOYOriginal
2016-08-08 09:22:14839browse

Preparation
1 Download apache http://httpd.apache.org/download.cgi#apache24 httpd-2.2.22-win32-x86-openssl-0.9.8t.msi
openssl means it comes with openssl module, you can use openssl Configure SSL secure link for Apache
2 Download php http://windows.php.net/downloads/releases/archives/ php-5.3.5-Win32-VC6-x86.zip
Download vc6 version
VC6: legacy Visual Studio 6 compiler, it is compiled using this compiler.
VC9: The Visual Studio 2008 compiler is compiled using Microsoft's VS editor.
3 Download mysql http://mysql.llarian.net/Downloads/MySQL-5.5/mysql-5.5.23-winx64.msi
Second installation
1 apache is relatively simple, complete the next step.

Browser verification , a page appears, successful

2 php installation

download the zip package, unzip it directly to a directory, rename the directory to php

3 mysql
abbreviated
three configurations
php configuration
php.ini -Rename the development file to php.ini
Specify the specific directory of the PHP extension package in order to call the corresponding DLL file

Copy the codeThe code is as follows:


; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
; extension_dir = "ext"


Modify to

Copy the codeThe code is as follows:


; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
extension_dir = "D:/servers/php/ext"


Remove the following configuration comments and support mysql

Copy the code The code is as follows:


extension=php_curl.dll
extension=php_gd2.dll
extension=php_mysql.dll
extension=php_pdo_mysql.dll
extension=php_pdo_odbc.dll


Support session
session.save_path = "e:/temp"
Upload file directory configuration
upload_tmp_dir ="e:/temp"
Time zone configuration
date.timezone =Asia/Shanghai
apache configuration
In #LoadModule vhost_alias_module modules Add

Copy the code under /mod_vhost_alias.so The code is as follows:


LoadModule php5_module "e:/servers/php/php5apache2_2.dll"
PHPIniDir "e:/servers/php"
AddType application/x-httpd- php .php .html .htm


Web home directory modification

Copy codeThe code is as follows:


DocumentRoot "D:/servers/Apache2.2/htdocs"


Changed to

Copy code The code is as follows:


DocumentRoot "D:/servers/phpweb"

Copy the code The code is as follows:



is changed to

Copy the codeThe code is as follows:


Copy the code as follows:


DirectoryIndex index.html

Change to

Copy the code The code is as follows:


DirectoryIndex index.php index.html

Restart apache
mysql configuration
About
Four tests
Create the phpweb directory D: serversphpweb
Create the test file index.php

Copy the code The code is as follows:

phpinfo();
?>

Browse: http://localhost
Display The following information indicates that the configuration is successful:

Create a mysql connection test file

Copy the code The code is as follows:

$c />if(!$connect) echo "Mysql Connect Error! ";
else echo "mysql connection successful";
mysql_close();
?>

The above introduces the apache+php+mysql environment configuration method under windows, including the relevant aspects. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
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