Build apache2.2.15 + php5.2.13 in Windows XP

Source: Internet
Author: User

1, download httpd-2.2.15-win32-x86-no_ssl.msihttp: // www.apache.org/

(There are two versions of SSL and no_ssl, which can be downloaded as needed)

Download php-5.2.13-Win32, http://cn.php.net/distributions/php-5.2.13-Win32.zip

(There is an installed version and a decompressed version. This time I use the decompressed version. Start with a php-5.3.2, when loading the module, always report errors, to my ability to query information, all said version problems, now

I haven't figured out why. I don't care about him for the moment. I need to set up PHP first)

 

2. install Apache first. Enter localhost in network domain and server domain and enter the Administrator's email address.

It is D:/program files. The installation is complete and starts properly. Enter the address 127.0.0.1 to check whether it works properly! It is works! OK! (If not, many

The number of requests is port usage. Check if any program occupies port 80. If it is disabled, all requests can be modified)

 

3. There is a configuration file in the Apache directory. httpd. conf needs to be configured to facilitate PHP running!

1) Search for "DocumentRoot". Here is the directory of the specified home page. Configure as needed!

2) search for "directoryindex". Here is the default homepage file name. This time we set up PHP and add index. php, which will be configured as needed!

3) search for "<directory/>" and change "Deny from all" to "allow from all ". You don't have permission to access/on

This server. This prompt is related to this parameter!

After the httpd. conf file is changed, restart Apache to take effect!

 

4. Configure PHP.

1) decompress the package to D:/program files/PHP,

2) Rename the php. ini-Dist file under the PHP Directory (D:/PHP) to PhP. ini, which is the configuration file of PHP. Modify the following information:

1. Modify extension_dir = "D:/PHP/EXT" in PHP. ini ";

Modify 2: doc_root = "D:/PHP", which must be consistent with DocumentRoot in httpd. conf;
Modify 3: default_charset = "UTF-8", modify the default Character Set, here, if there is a semicolon ";", remove this semicolon;
4. Change register_globals = off to register_globals = on to make the passed global variable valid;

Modify 5: Search for extension and modify
Extension = php_dba.dll if there is a semicolon in front, cancel the semicolon, the same as below;
Extension = php_dbase.dll
Extension = php_gd2.dll GD library is used for drawing verification codes;
Extension = php_mysql.dll is used to connect to the MySQL database;

3) copy the php5ts. dll and php5apache2_2.dll files in the PHP Directory to C:/Windows/system32.

 

4) modify the httpd. conf file of Apache. In this file

# Loadmodule ssl_module modules/mod_ssl.so

Loadmodule php5_module D:/PHP/php5apache2_2.dll,

Add addtype application/X-gzip. GZ. tgz
Addtype application/X-httpd-PHP. php.

5 or above, the configuration process of Apache and PHP is completed, and Apache is restarted. Create a file in the default directory of the server

Index. php, write the following code:
<? PHP
Phpinfo ();
?>

 

 

Pay attention to the following points,

1. Note the difference between APACHE and PHP configuration files (// and)

2. program file = progra ~ 1. The path cannot contain spaces.

 

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.