Install Apache server, PHP and MySQL database

Source: Internet
Author: User
Tags php and mysql

Recently heard that PHP5.4 is fast, so I want to build a local environment test. I'm going to install PHP5.4.8, Apache2.4.3, and Mysql5.5.28 with local Windows XP SP3.

First download the latest version of PHP, Apache, and MySQL.

PHP5.4.8 version: http://windows.php.net/download/

Mysql5.5.28 version: http://www.mysql.com/downloads/mysql/

Apache2.4.3 version: http://www.apachelounge.com/download/

Download Apache Note In this page also download a DLL file: Php5apache2_4.dll-php-5.4-win32.zip (with PHP version must correspond)

The preparatory work has been completed.

Here's how to install Apache, this is the most troublesome, the other is much simpler.

Part I: Installing Apache2.4.3

1. Download the extracted files, unzip and put in the location to be installed. (I take D:\Acpache24 as an example)

2. Open the apache24\conf httpd.conf file and open it with Notepad.

(1) The 37th line ServerRoot "C:/apache24" to ServerRoot "D:/apache24";//apache the location of the program.

(2) The No. 204 line of the serveradmin change does not matter;

(3) The "#" in the front of the No. 213 line servername is removed;

(4) The No. 237 line DocumentRoot "C:/apache24/htdocs" to DocumentRoot "d:/www";//root directory of the website

Line No. 238 <directory "C:/apache24/htdocs" > Changed to <directory "D:/www" >;

Note: This WWW folder to be built on its own, do not build the words will be error.

(5) Line No. 271 DirectoryIndex index.html Change to DirectoryIndex index.html index.php index.htm//Support more default pages

(6) No. 354 line scriptalias/cgi-bin/"c:/apache24/cgi-bin/" changed to scriptalias/cgi-bin/"d:/apache24/cgi-bin/"

(7) Line No. 370 <directory "C:/apache24/cgi-bin" > Changed to <directory "D:/apache24/cgi-bin" >3. Start Apache. Start---Run, enter cmd, and open a command prompt. Then enter D: Enter CD Apache24\bin enter httpd enter

If the httpd.conf is configured correctly, there is no prompt after entering httpd carriage return.

5. Test. You can put the index.html in the Apache24\htdocs directory in the D:\www directory, access to the browser will appear "It works" that the Apache has been installed correctly.

Note: You cannot turn off this command window, otherwise Apache will shut down.

6. Join the system service for Windows and let Apache self-boot.

(1) Close the 3 httpd command window, or you will get an error.

(2) Start---Run, enter cmd, and then open a command prompt. Input d: Carriage return CD Apache24\bin Enter

The command to join the service here is: Httpd.exe-k install-n "ServiceName"

ServiceName is the name of Apache in Windows services. Example: Httpd.exe-k install-n "Apache24"

After entering Httpd.exe-k install-n "Apache24", there will be a successful installation of the prompt, "service" will also have Apache24 this service item. This time you can choose to start the Apache service.

If you want to uninstall this service, first stop the service and then enter Httpd.exe-k uninstall-n "Apache24" to uninstall the service.

This Apache can be controlled later by ApacheMonitor.exe under the Apache24\bin folder. The taskbar will also have a very handy management Apache run that shows this software.

Attached: You can put Apache24 in the C packing directory, that is C:\Apache24

Above 2, as long as the Change (3) (5), the cmd command directly input CD C:\apache24\bin carriage return httpd Enter, so much simpler.

Here the basic installation of Apache has been finished.

Let's start by saying that PHP is installed.

Part II: Installation of PHP5.4.8

1. Download the extracted files, unzip and put in the location to be installed. (I take D:\PHP as an example)

At the same time unzip Php5apache2_4.dll-php-5.4-win32.zip select PHP 5.4.7 in the Php5apache2_4.dll to put in the PHP directory.

Note: There is no PHP5.4.8 version of Php5apache2_4.dll, so I chose one of the latest versions.

2. Copy the php.ini-development and rename it to PHP.ini.

3. Open apache24\conf under Httpd.conf, at last add

# PHP5 supportLoadModule"D:/php/php5apache2_4.dll"AddHandler Application/x-  httpd-.  PHP# Configure the path to php.iniphpinidir"d:/php"        

Used to support PHP, where d:/php is the PHP root directory. Because of the use of Apache2.4.3, Php5_module is Php5apache2_4.dll.

4. Restart the Apache server.

5. Test. Delete other files in www, create a new index.php, the content is <?php phpinfo ();?> Save, access the information that appears in PHP indicates that PHP has been successfully installed.

The basic installation of PHP has been completed here.

The following is the installation of MySQL.

Part III: Installation of Mysql5.5.28

1. Run the installation files directly, this is not specified here.

2.php support MySQL Settings

(1) the No. 730 line; Extension_dir = "ext", remove the front ";" and change to Extension_dir = "D:\PHP\ext"

(2) No. 880 and 881, remove the preceding ";"

Extension=php_mysql.dll
Extension=php_mysqli.dll

Note: There are many DLLs in lines No. 838 through No. 908, what you need to use, and remove the previous ";" You can do it.

(3) Restart Apache.

The MySQL installation is basically done here.

The rest is some apache,php and MySQL settings, this thing is more, this is the benevolent see of things. I'm not caught dead here either.

Install Apache server, PHP and MySQL database (GO)

Related Article

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.