Win9x/me apache+php Installation Configuration _php Tutorial

Source: Internet
Author: User
Apache server, one of the many Web server software, has become one of the most popular Web server software available on the Internet. Compared to other Web server software (such as PWS, IIS, UNIX), Apache has the advantages of easy installation, simple configuration and easy management. What's more, it's completely free like PHP! So I was favored by a lot of friends, let me tell you how to install and configure Apache and PHP, come on, follow me STEP by step!

First step: Download Apache Server. Apache server's latest version in the official Apache website (http://www.apache.org) can be found, in fact, we do not need to go abroad to download, there are several sites in the country, such as http://phpuser.com,/HTTP/ www.php.com.cn, http://www.phpchina.com all have, download speed quite fast! After downloading the general file name is Apache_1_3_x_win32_r2.exe's self-extracting installation file. Where 1_3_x is the Apache version number, we are using the latest version of 1.3.14.

Step two: Install Apache Server. As with the general software, the installation process is very simple, go all the way [next], just to change its installation directory to [C:\Apache] (Figure 1), after installation in Win98 [Start]-〉[program] will be more [Apache Web Server] a project. This time Apache server installed successfully, you can next!!


Figure 1

Step three: Configure Apache Server. The configuration of Apache server is a bit of a hassle, because Apache server was originally run on UNIX and has many UNIX features, such as its configuration requires a dedicated configuration file (suffix conf) to complete. Earlier versions of Apache server have three files: httpd.conf, srm.conf, and access.conf require the user to configure themselves. Now we do not need to use the version of the three files are configured, as long as the configuration httpd.conf on the line! The following is the most critical configuration. Open the httpd.conf file (C:\Apache\conf\httpd.conf) in [CONF] in the [Apache] directory under the C-packing directory using WIN98 's own [Notepad]. This file is very long, but we need to change the place is not many, and carefully look at the structure of this file is not complex, it is composed of statement statements and project configuration statements. The preceding "#" is a comment on this sentence, which is a statement that does not work, and the other is the configuration statement. In the configuration statement, make the following changes:

1: Find ServerType (server type), there are two for [standalone] and [Inetd],[standalone] are using their own process to listen to each connection, and [inetd] is to start the Apache process when the connection arrives. Generally set to standalone, that is, this line should read: ServerType standalone

2: Locate ServerRoot (server root directory), ServerRoot is the Apache Server installation directory, this line should read:
ServerRoot "C:\Apache"

3: Find port (server port), generally by default is 80, if your PC is also equipped with other web Server, it must be separated, such as a 80, a 8080 can be!! Instead: Port 80

4: Find serveradmin (server management), this should be filled in is the server administrator's e-mail. If the server generates an error, the address is automatically added to the error page, and you can ask him for help! It can also be changed here.

5: Find servername (server name), this setting is very important, she is your computer's network identity, generally localhost. Of course, you can also customize it, but be sure to write the same as you would in Win98 's network logo (Figure 2), instead:
ServerName localhost

Figure 2

6: Find DocumentRoot (document Root), here is the default home directory address, that is, in the Internet Explorer address bar input http://localhost/when IE will automatically go to this directory to find index.html files. Switch

DocumentRoot "C:/apache/htdocs" (note the path must enclose the quotation marks)

7: Find DirectoryIndex (the default page), this default page is the Internet Explorer in the Address bar when you enter localhost when the screen appears. You can set multiple file suffix names, such as. htm,. html,. php,. Ph3. Here instead:

DirectoryIndex index.html index.htm index.php3 index.php (note to use a space interval), after the change in the C:\Apache\ Htdocs file Index.html.en changed to index.html, let IE browser recognize.

8: Find Scriptalias (script alias), here is the directory of the specified CGI program, instead:

scriptalias/cgi-bin/"c:/apache/cgi-bin/" (note the path must enclose the quotation marks)

To this end, the Apache server configuration is basically complete, you can check the configuration is correct. Run Apache Server first ([start]) [Program]-[Apache Web server]-] [start Apache]). Successful run will pop up a DOS window (Figure 3), if the popup immediately disappears or DOS window content is not Figure 3, then it is likely that your 5th (ServerName) is not set to. After successful operation, enter http://localhost/in the address bar of IE browser, if correct, the Figure 4 screen should appear. This means that you have successfully configured the Apache server.

Figure 3


Figure 4
Fourth Step: Install and configure PHP. PHP can go to http://www.php.com.cn download to get the latest version. We use the 4.04 version, the download file is Php-4.0.4-win32.zip, the size of 2.7MB. Unzip it to C:\PHP4 and the installation is over.

Fifth step: Configure PHP. Rename the file Php.ini-inst in the C:\PHP4 directory to php.ini and make the following changes:

1: Find doc_root=. It is the root directory of the server, instead:

Doc_root=c:\apache\htdocs

2: Find extension_dir=./instead:

Extension_dir=c:\php4

Save and then copy the file php.ini under the C:\php4\ directory to the C:\windows directory.

The sixth step: Apache Server and PHP will work. The last step is to make them work at the same time. Open the configuration file httpd.conf in the C:\apache\conf directory and make the following changes:

1: Find [DocumentRoot "C:/apache/htdocs"] under the first appearance [ ], change it to:


Options FollowSymLinks
AllowOverride None

2: Add a few words to the end of this file, which means that Apache server can recognize the PHP application. Add the following:
scriptalias/php3/"c:/php4/" AddType application/x-httpd-php. PhP3. phtml. PhP4
Action application/x-httpd-php "/php4/php.exe"

OK, so far, all the configuration work is done! It's not too hard to look back. Isn't it? Finally check if it is successful!

Make a PHP program as follows:

?
Print ("I have successfully configured the apache+php!!! under Win9x/me");
? >

The program named test.php and saved in the C:\apache\htdocs directory, and then open IE, in the address bar input http://locahost/test, as shown in Figure 5 screen is done!!

Figure 5

http://www.bkjia.com/PHPjc/314596.html www.bkjia.com true http://www.bkjia.com/PHPjc/314596.html techarticle Apache Server, one of the many Web server software, has become one of the most popular Web server software available on the Internet. Compared to other Web server software (such as PWS, IIS, UNIX), ...

  • 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.