Install and configure PHP in Windows

Source: Internet
Author: User
Software Version: php-5.3.1-Win32-VC6-x86.zip this does not require additional installation of. net Library, so it is used. You can use another one. 1. install PHP in green mode. Download the Zip file and decompress it. 2. Find php. ini-development in the extracted root directory, which is the configuration file used for the development environment. There is also a php. ini-prod

Software Version: php-5.3.1-Win32-VC6-x86.zip this does not require additional installation of. net Library, so it is used. You can use another one. 1. install PHP in green mode. Download the Zip file and decompress it. 2. Find php. ini-development in the extracted root directory, which is the configuration file used for the development environment. There is also a php. ini-prod

Software Version: php-5.3.1-Win32-VC6-x86.zip

This does not require additional installation of the. net library, so it is used. You can use another one.

1. PHP installation

Download the Zip file in green and decompress it.


2. Configuration

Find php. ini-development in the extracted root directory, which is the configuration file used for the development environment. There is also a php. ini-production, which is the configuration file used for the production environment. Use php. in-development to copy a copy and rename it to php. ini. Start editing.

Locate registe_globals = Off;

We recommend that you do not open it. The difference is that this value is used to open global variables, such as the value sent from the form. If this value is set to "Off ", you can only use "$ _ POST ['variable name'], $ _ GET ['variable name']" to obtain the sent value. If it is set to "On ", you can directly use the "$ variable name" to obtain the sent value. Of course, setting it to "Off" is safer, so that data transmitted between webpages is not intercepted easily. If this value is changed to "On", it depends On your own feeling. Is it important for security or convenience?

To enable php to call other modules, you can search by the extension keyword, locate the following, remove the semicolon before the option, and enable the support of this module.

The more modules are loaded, the more resources are occupied, which can be ignored. For example, to enable mysql support, find the following

; Extension = php_mysql.dll

Remove the preceding ";" comment.

All modules are placed in the ext directory under the php decompression Directory, which can be enabled as needed.

Error in loading module:

Sometimes, when Apache is started, the error "the specified module cannot be found" is prompted because the location of these module files is not specified and the keyword "extension_dir" is located ", modify the directory of your PHP module in Windows.

For example, if my PHP Directory is in D: \ PHP, configure

Extession_dir = "D: \ PHP \ ext"

In this way, no error is reported when Apache is started.

3. Work with Apache

Php combines modules with Apache to open the configuration file of Apache and locate the module to be loaded with the keyword "LoadModule,

Add the following two lines at the end:

LoadModule php5_module D:/php/php5apache2_2.dll

PHPIniDir "D:/php"

The first line "LoadModule php5_module D:/php/php5apache2_2.dll" indicates loading php in module mode, and the second line "PHPIniDir" D:/php "indicates the php configuration file php. the ini location is, of course, where "D:/php" should be changed to the directory you have previously selected for php decompression.

Php5apache2. dll and php5apache2_2.dll are included in the php decompression directory. Because our apache version is 2.2, we load the dll.

You can configure php5apache2_2.dll as needed.

Search by the keyword AddType application. You can define the PHP file type that can be executed,

Original article: AddType allows you to add to or override the MIME configuration
# File specified in TypesConfig for specific file types.

Join

AddType application/x-httpd-php. php

AddTypeapplication/x-httpd-php.html

Two lines, you can also add more, the essence is to add file types that can execute php, for example, if you add a line "AddTypeapplication/x-httpd-php .htm.pdf", the .htm file can also execute the php program. You can even add the last line "AddTypeapplication/x-httpd-php. txt, so that common text txt can also run php programs.

The basic configuration of PHP is complete.

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.