apache,php Configuration

Source: Internet
Author: User

Many friends want to configure the Apache+php+mysql running Environment under window, in fact, from such a long experience, Win2003 still use IIS, if in order to learn or for Apache especially familiar with the friend can use Apachea preparation
1 downloads for Apache Http://httpd.apache.org/download.cgi#apache24 httpd-2.2.22-win32-x86-openssl-0.9.8t.msi

OpenSSL with OpenSSL module, using OpenSSL to configure SSL secure links 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 is compiled with this compiler.

Vc9:the Visual Studio 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

Two installation
1 Apache is relatively simple, all the way next complete.

Browser verification, the page appears, the success

2 PHP Installation

Download the zip package, unzip it directly to a directory, rename the directory to PHP

3 MySQL
Slightly
Three configurations
PHP Configuration
Php.ini-development file renamed to PHP.ini
Specify a specific directory for the PHP extension package to invoke the appropriate 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"
Revision 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 to 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"
Switch
Copy CodeThe code is as follows:
DocumentRoot "D:/servers/phpweb"
Copy CodeThe code is as follows:
<directory "D:/servers/apache2.2/htdocs" >
Switch
Copy CodeThe code is as follows:
<directory "D:/phpweb" >
Copy CodeThe code is as follows:
<ifmodule dir_module>
DirectoryIndex index.html
</IfModule>
Switch
Copy CodeThe code is as follows:
<ifmodule dir_module>
DirectoryIndex index.php index.html
</IfModule>
Restart Apache

MySQL Configuration
Slightly
Four-Test
Establish the Phpweb directory D:\servers\phpweb

Create a test file index.php
Copy CodeThe code is as follows:
<?php
Phpinfo ();
?>
Browse: http://localhost
Displays the following information indicating the configuration was successful:

Create a MySQL connection test file
Copy CodeThe code is as follows:
<?php
$connect =mysql_connect ("10.71.196.147", "User", "" ");
if (! $connect) echo "Mysql connect error!";
else echo "MySQL connection succeeded";
Mysql_close ();
?>
Browse: http://localhost/mysqltest.php Test MySQL Connection

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.