Installation and configuration of Apache1.3.x + PHP4Beta3 in Windows9x/NT

Source: Internet
Author: User
Tags apache windows parse error php3 file
1. install Apache to the official site of Apache, htp: www.apache.orgdist. download apache_1_3_x.win32.exe to your local machine and install it to c: Apache. If there is nothing wrong with the installation, Apache will be ready to use after the installation is complete. There are many readme files under the Apache installation directory for reference, but only Apache

1. install Apache

To the official site where Apache is released. htp: // example. If there is nothing wrong with the installation, Apache will be ready to use after the installation is complete. There are many readme files under the Apache installation directory for reference, but only one file is about the Win32 Platform, including Window 9x and Windows NT.

II. install PHP

Go to the official PHP release site, select an image, find the download area, select "Source code and Windows distribution", and download "Windows Binary ". You only need to extract the downloaded file 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

The file package distributed with PHP contains the main configuration file PHP. INI-dist. 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 adding MySQL support. Find the "Dynamic Extensions" column in the PHP. ini file:
;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions;
;;;;;;;;;;;;;;;;;;;;;;
Modify; extension = php_mysql.dll
Remove ";" from the front


Under certain circumstances, if the DLL file you want to use is not in this list, simply add a line, such as "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 in your favorite file editor. \ conf \ httpd. conf file. In this example, it is c: \ Apache \ conf \ httpd. conf (this is the most important configuration file of APACHE ). 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"

Note that the preceding three rows cannot be written incorrectly. The last part of the first line is the Directory of the PHP you installed. you can copy and paste the following two lines from here. The configuration commands in this line are case sensitive.

5. run Apache in Windows NT

If you are running a Windows NT system, you may need to run Apache as a service process of the system. Click "Start", select "program", and run "Install Apache as Service" under "Apache Web Server ". In this way, you can manage Apache startup and termination through the "Service" program in the control panel of NT. Unless for special reasons, I suggest you change the "Apache Service" running mode to "manual": open the Control Panel, select the "Service" icon, and find "Apache Service ", click "run" to set the running mode to "manual ". However, to run Apache, you must start it yourself. However, Apache will automatically close when NT is disabled, and you will not see any Apache windows.

6. run in Windows 9x

If you are using Windows 9x, I suggest you download "Apache Manager for Windows" from the author's website ". It stays in the lower right icon bar while running, and hides the console window created by Apache. This program allows you to directly start, stop, and restart Apache without the annoying command line. If you do not need "Apache Manager", you should start Apache by selecting "start", "program", "Apache webserver", and "Apache Server, do not close the window that pops up when Apache is started. if it is turned off, Apache will stop. To stop running Apache, open a MS-Dos window, switch to the directory where you install Apache, and execute the following command: apache-k shutdown Apache takes a moment to close its console window. This is mainly to ensure that all processes are uninstalled and all. conf and. log files are closed. This is exactly why the author wrote Apache Manager.

7. test your system

I strongly recommend that you run Apache at least once in the console window. To obtain information displayed during Apache running, you can use the control window or error. log file. The error. log file is stored in the log subdirectory of the Apache installation directory. For example, c: \ Apache \ log \ error. log.
Run Apache. if everything is OK, you should be able to see the following information:

Apache/1.3.9 (Win32) running...

If you fail to see this message or the Apache window is transient, you must start Apache from the Dos window as a command line. Switch to the directory where you install Apache and type "Apache" to see what messages are displayed. If it is "parse error in the conf file", the problem may be caused by your httpd. conf. Check and correct the error.

All started to work normally. To test your system, open a browser and enter the following address: http: // localhost/. you will see a page displayed by Apache, it says something like "It works. If this page does not appear, your TCP/IP configuration may be incorrect. copy the sam file as the hosts file and check whether there is a "127.0.0.1 localhost" line, which is not commented out.

Next, try the php file. If it does not work, check whether your httpd. conf settings are correct. this is important. If not, Apache does not know how to process the. php3 file.

8. use Directory alias (Directory Aliases)

You don't have to put everything in the htdocs directory. In order for Apache to correctly point to the directory you want, you must edit the httpd. conf file and add the "Alias" command. It is very simple, as shown below:

Alias/yoursite/"c: path/to/your/web/site /"

Restart Apache and the Directory you created will start to work. Open http: // localhost/yoursite/in your browser /. Of course, you can replace "yoursite" with your preferred name ".

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.