Installation and configuration of Apache and PHP in WindowsNT (1)

Source: Internet
Author: User
Tags php email
: This article mainly introduces the installation and configuration of Apache and PHP in WindowsNT (1). If you are interested in the PHP Tutorial, refer to it. The most frequently asked question in the php email list is: "How to install PHP on my Windows machine ?", Maybe I can help answer this question. After the installation is complete, you will find that developing PHP programs in Windows is still good.

The purpose of this tutorial is to show you how to develop PHP programs using a combination of Apache and Windows.

If no specific version is specified in the tutorial, PHP is PHP3, PHP4 Beta 2 or 3, and Apache is 1.3.x.

1. install Apache

First, you need a WEB server. I recommend Apache. First go to htp: // www.apache.org/dist. On this page, there is a list of worldwide Apache image sites. find the one closest to you. Apachesoftware is generally called apache_1_3_x.win32.exe. Run it on your machine. It will ask you where to install Apache, and you can set it to c: \ Apache, because you will modify its configuration file immediately. If there is nothing wrong with the installation, Apache can be used. There are many readme files for reference, but only one file is about Win32 Platform, including Windows 9x and Windows NT.

II. install PHP

This problem occurs too many times in the PHP email list. You need to install the latest PHP version for Windows. You may want to compile PHP3 on your own, but I don't think it is necessary for general development purposes. PHP also has image sites all over the world (which does not seem to exist in China ). Select an image, find the download area, select "Source code and Windows distribution", and download "Windows Binary ". You only need to Unzip the downloaded file (WinZip is good) to your favorite Directory, such as C: \ PHP4B3. we recommend that you use the version number as the directory name, so that you do not need to delete the old version when you try to update the version in the future.

Install PHP4 Beta in Windows 95/97 with DCOM support. If your machine is not installed, download one here.

3. configure PHP

There is a Readme file in the package that is distributed with PHP, which describes how to configure it. There is a file named PHP. INI-dist, which is the main configuration file of PHP. Copy it to your Windows system directory (Windows 9x \ Windows or Windows NT \ WinNT directory) and change it to PHP. INI. You need to make proper modifications to this file. The most important thing is to add modules that may be used, such as MySQL. Find the following section in the PHP. ini file:

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions;
;;;;;;;;;;;;;;;;;;;;;;
; If you wish to have an extension loaded automaticly, use
; Following syntax: extension = modulename. extension
; For example, on windows,
; Extension = msql. dll; or under UNIX,
; Extension = msql. so
; Note that it shoshould be the name of the module only,
; No directory information needs to go here.
; Specify the location of the extension with
; Extension_dir directive above.

The following lines are annotated, as shown in

Windows Extensions
; Extension = php_mysql.dll
; Extension = php_nsmail.dll
; Extension = php_calendar.dll
; Extension = php_dbase.dll
; Extension = php_filePRo.dll
...

All you need to do is remove the comments of some lines in the file, that is, delete the semicolons. I needed MySQL support and removed the semicolon ";" from the "extension = php3_mysql.dll" line. in specific cases, the DLL file you want to use is not in this list, just add a line, for example, "extension = mydll. dll ". In this way, PHP is configured.

4. let Apache and PHP work together

Find the directory where you installed Apache in section 1 and open it with your favorite file editor (preferably in Win32 long file name format, such as Edit and Ultraedit. \ conf \ httpd. conf file. In this example, it is c: \ Apache \ conf \ httpd. conf (this is the most important configuration file of APACHE. do not modify it easily unless you are certain ). If you cannot understand the content, go to the Apache documentation. To make Apache and PHP work together, you only need to add a few lines, as shown below:

ScriptAlias/php4b3/"C:/PHP4B3 /"
AddType application/x-httpd-php3. php3
AddType application/x-httpd-php3. php
AddType applications/x-httpd-php3. phtml
Action application/x-httpd-php3 "/php4b3/php.exe"



The above introduces the installation and configuration of Apache and PHP in Windows NT (1), including the installation of Apache and PHP, and hope to help those who are interested in the PHP Tutorial.

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.