Windows PHP5+APACHE2+MYSQL5 Installation and Setup

Source: Internet
Author: User
Tags mysql client win32

Compared with JSP, PHP has a simple learning, fast running updates, high security features, so when writing dynamic Web pages, PHP is the first choice. As we all know, PHP learning program can only run on the server side, so to run the program you write, in addition to downloading PHP program compiler, but also download a Web server software. If it is using Microsoft's iis,php performance is not fully play out. As long as the Apache and PHP collocation is the best solution, this advantage is particularly prominent under Linux, we download the following together to install:

1. Apache2
Download the installation Apache2 first, you can download it to its official website (http://www.apache.org).
Download Address:http://archive.apache.org/dist/httpd/binaries/win32/
Download the file as: Apache_2.0.53-win32-x86-no_ssl.exe, double-click the installation, the following figure:

Figure I. Installing Apache is the place to be noted
Open IE Browser, enter in the address barhttp://localhostAfter the point of return, if you can see the following figure, the installation is correct



Open the installation address. \apache2\conf file httpd.conf, find DocumentRoot "C:/Program Files/apache2/htdocs", modify the path for your site location, such as DocumentRoot "D:/web." Note: "\" here to change to "/". Save httpd.conf file and start Apache. As shown in the following illustration:

2. PHP
First we go to the PHP official website (http://www.php.net)Download PHP5.
Download Address:Http://www.php.net/get/php-5.1.0RC1-Win32.zip/from/a/mirror
The download file is: Php-5.1.0rc1-win32.zip. After decompression renamed PHP, test into the C-packing directory can be.
Below we set up Apache and PHP so that they can work together. Open the file Install.txt in C:\php and find example 2-5. PHP and Apache 2.0 as CGI row, that is, adapt to the Apache 2.0, the following statements will be copied to the httpd.conf file, save the httpd.conf file and then the Apache.

The statements to be copied are as follows:
scriptalias/php/"c:/php/"
AddType application/x-httpd-php. php

& #35; For PHP 4
Action application/x-httpd-php "/php/php.exe"

& #35; For PHP 5
Action application/x-httpd-php "/php/php-cgi.exe"




Since PHP 5 no longer binds MySQL client libraries, as we did when we ran the PHP program
Fatal error:call to undefined function mysql_connect ()
Please do not worry, we manually activate the Php_mysql.dll extension Library in php.ini, it is OK, the method is very simple, the php.ini-dist in C:\php is named PHP.ini, find the following statement
......
; Extension=php_mssql.dll
; Extension=php_msql.dll
; Extension=php_mysql.dll
; Extension=php_oci8.dll
.....
The first is to remove; Extension=php_mysql.dll front ";" (; for comments), the second step is to copy the Php_mysql.dll from the C:\php\ext to C:\WINDOWS (C:\WINNT), or to increase the path value of the environment variable; C:\php\ext. Save and start Apache.
?
Phpinfo ();
?>
After running, if the following figure is displayed, the settings are correct


Article entry

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.