Install PHP4.1.1 using the Apache module in Windows2000

Source: Internet
Author: User
Tags apache download connect to microsoft sql server php download
FONTstyleFONT: 12px install PHP4.1.1 □text Platinumwww.soulogic.com in the Apache module in Windows2000. the original address is www. soulogic. complatinumdocapachemodule

FONT style = "FONT: 12px ">

Install PHP 4.1.1 using the Apache module in Windows 2000

□Text/Platinum www.soulogic.com

Article original address http://www.soulogic.com/platinum/doc/apachemodule/, if you follow this article after the installation of what problems, please the software version, to which step, the error prompt or phenomenon to tell me, my e-mail is a platinum@soulogic.com, or a message on my message board, the address is a http://www.soulogic.com/guestbook/

This article can be reproduced at will, but please respect the authority of the Author

--------------------------------------------------------------------------------

The software version used by the author is:
Windows 2000 Server build 2195
PHP 4.1.1
Apache 1.3.22


--------------------------------------------------------------------------------

If you are installing PHP for the first time, I hope you can install PHP in full accordance with the instructions below (including the path name). If you have successfully installed PHP in CGI mode, to try the Apache module method, click here to go to step 4.

Step 1: download the software

A necessary habit is to download the required software only on the official site.
Apache download page: http://www.apache.org/dist/httpd/binaries/win32/
PHP download page: http://www.php.net/downloads.php
※Note: PHP must download the zip package instead of the. exe file. Otherwise, it cannot be installed as a module.

Step 2: install Apache and PHP

The entire installation process is very simple. to run the Apache installation file, you need to fill in the host name and administrator mailbox in the middle. if it is a single machine, you don't have to worry about this. just write anything at will. It can be modified later.
For the interface during Apache installation

For PHP, simply extract the PHP package to a directory.
Here I recommend my habits. Generally, people install Apache into C: \ Program Files and decompress PHP to C: \ PHP -- I think this is only required when your hard disk has only one partition. I used to put all of them in the E: \ Server directory, and all the things related to Web Server will be put there in the future, for example, MySQL. In this way, it is very easy to restore the entire Web Server after you reinstall the system.
Installation Path.

After Apache is installed, it starts to run. in the future, you can Start (Start) and Restart (Restart) through the Start menu program → Apache HTTP Server → Control Apache Server) or Stop Apache. Of course, you can also perform the same operations on Apache through the "service" in the "administrative tools.

Step 3: configure the httpd. conf file of Apache

You can modify the Apache option by editing the httpd. conf file in the conf directory of Apache. open it in a text editor. This file is large, with more than one thousand lines by default.
The content of the comment starting with # does not have any effect.
First, change E:/Server/Apache/htdocs in DocumentRoot "E:/Server/Apache/htdocs to the directory where the web page is stored for you, such as E:/www, note that the slash "/" is not the usual backslash "\" (the same below ).
※Note: After http. conf is changed, it must be restarted in the menu to make it take effect. This is a problem that can be easily forgotten at the beginning.
Now, copy an HTML file, for example, index.html, to the E: \ www Directory, open the browser, and enter http: // localhost/index.html in the address bar, if you can see this file, Apache is working properly.

Step 4: install PHP in modules

First, set PHP under the PHP Directory (E: \ Server \ php. ini-recommended file renamed php. ini and copy it to the Apache Directory, for example, "E: \ Server \ Apache ". Like httpd. conf, all PHP configuration options are recorded in php. ini. Here are a few changes:
Extension_dir =./to extension_dir = "E: \ Server \ PHP \ extensions"
Doc_root = to doc_root = "E: \ www"
Session. save_path =/tmp to session. save_path = "C: \ WINNT \ Temp"
; Upload_tmp_dir = changed to upload_tmp_dir = "C: \ WINNT \ Temp ". Note: remove the number, the same below.
; Default_charset = "iso-8859-1" to default_charset = "gb2312"
There is a row; extension = php_xxx.dll remove the marker starting with as needed. for example, php_gd.dll can be used for graph creation by using the GD library and php_mssql.dll to connect to Microsoft SQL Server. If you do need this function, remove the; number. Otherwise, you can only waste system resources.

--------------------------------------------------------------------------------

After modifying PHP. ini, copy the php4ts. dll file under the PHP directory to the C: \ WINNT \ system32 directory.


--------------------------------------------------------------------------------

Finally, modify the httpd. conf file of Apache. Add the following three lines at the end of the file:
LoadModule php4_module E:/Server/PHP/sapi/php4apache. dll
AddModule mod_php4.c
AddType application/x-httpd-php. php
Third, set the suffix. if you want to, you can continue to add
AddType application/x-httpd-php. php3
AddType application/x-httpd-php. phtml
In this way, all files with the suffix on the server will run as PHP scripts.
Search for the DirectoryIndex index.html line, and add "index. php" before index.html. there must be spaces between the two.


--------------------------------------------------------------------------------

After all these operations are completed, restart Apache. Create a file named ver. php on E: \ www. The file contains only three lines:
   Phpinfo ()
?>
After saving the file, open your browser and enter http: // localhost/ver. php in the address bar. if you can see a long form, the installation is successful, as shown in.

The third line of Server API indicates that the current mode is Apache module.
Open the management tool> service. you can also see that the description of Apache has changed.

If you see the same picture on your machine, congratulations! you have installed the PHP module.

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.