Home >Backend Development >PHP Tutorial >Apache php mysql environment configuration method under windows, apachemysql_PHP tutorial

Apache php mysql environment configuration method under windows, apachemysql_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 09:48:58886browse

apache php mysql environment configuration method under windows, apachemysql

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. Openssl can be used to 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 , compiled using this compiler.

VC9: the Visual Studio 2008 compiler is compiled with 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, all the way to next is completed.

Apache php mysql environment configuration method under windows, apachemysql_PHP tutorial

Browser verification, the following page appears, successful

Apache php mysql environment configuration method under windows, apachemysql_PHP tutorial

2 php installation

Download the zip package, extract it directly to a directory, and rename the directory to php

Apache php mysql environment configuration method under windows, apachemysql_PHP tutorial

3 mysql
Omitted
Three configurations
php configuration
php.ini-development file is renamed to php.ini
Specify the specific directory of the PHP extension package in order to call the corresponding DLL file

Copy 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"


was changed to

Copy 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 codeThe 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
Add under #LoadModule vhost_alias_module modules/mod_vhost_alias.so

Copy codeThe 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 codeThe code is as follows:
DocumentRoot "D:/servers/phpweb"

Copy codeThe code is as follows:


changed to

Copy codeThe code is as follows:

Copy codeThe code is as follows:

DirectoryIndex index.html


changed to

Copy codeThe code is as follows:

DirectoryIndex index.php index.html


Restart apache

mysql configuration
Omitted
Four tests
Create phpweb directory D: serversphpweb

Create test file index.php

Copy codeThe code is as follows:
phpinfo();
?>


Browse: http://localhost
The following information is displayed, indicating that the configuration is successful:

Apache php mysql environment configuration method under windows, apachemysql_PHP tutorial

Create mysql connection test file

Copy codeThe code is as follows:
$connect=mysql_connect("10.71.196.147","user","");
if(!$connect) echo "Mysql Connect Error!";
else echo "mysql connection successful";
mysql_close();
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1020826.htmlTechArticleapache php mysql environment configuration method under windows, apachemysql 1 preparation 1 Download apache http://httpd.apache.org /download.cgi#apache24 httpd-2.2.22-win32-x86-openssl-0.9.8t.msi openss...
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