Windows PHP Installation Configuration ____php

Source: Internet
Author: User


This does not require additional installation of the. NET Library, so use this one. You can use the other.

1.PHP Installation

Use the green way to download the zip file to extract.


2. Configure

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

Positioning registe_globals =off;

It is not recommended to open, except that this value is used to open global variables. For example, the value of the form sent, if this value is set to "off", you can only use "$_post[' variable name '", "$_get[' variable name '", etc. to obtain the value sent, if set to "on", you can use the "$ Variable name "To get the value sent over, of course, set to" off "is more secure, will not make it easy to intercept the data transferred between the pages. Whether this value is changed to "on" depends on how important it is to be safe or convenient.

To enable PHP to invoke other modules, you can search with the extension keyword, navigate to the following, remove the semicolon before the option, and then open the support for this module.

The more modules you load, the more resources you will need to consume, which you can ignore. For example, to enable MySQL support, find the following

; Extension=php_mysql.dll

Remove the front of the ";" Comment on it.

All of the modules are placed in the Ext directory in the PHP extract directory and can be enabled as needed.

Load Module Error:

Sometimes when you start Apache, you are prompted to "not find the specified module" error, because you do not specify the location of these module files, locate the keyword "Extension_dir", modify the Windows for your PHP module directory.

For example, if my PHP directory is D:\PHP, configure

Extession_dir = "D:\PHP\ext"

This will not be an error if you start Apache.

Here is one of the easiest ways to directly install the PHP path, the ext path inside is specified to the Windows system path--right on my Computer, properties, select the Advanced tab, click Environment variables, locate the "Path" variable under System variables, select, double-click or click "Edit", add ";D: \php;d:\php\ext" to the back of the original value, of course, the "D:\php" is my installation directory, you want to change it to your own PHP installation directory, as shown in the following figure, all OK.

3. Work together with Apache

PHP in Modular way with Apache, open the Apache configuration file, with the keyword "LoadModule" positioning, configure the module to load,

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" refers to loading PHP in module mode, the second line "Phpinidir" d:/php "" is to indicate the location of the PHP configuration file php.ini, of course, where the "d:/php" is changed to the PHP uncompressed directory you chose earlier.

In the PHP extract directory at the same time there are php5apache2.dll and Php5apache2_2.dll, because our Apache version is 2.2, so load the DLL

Using Php5apache2_2.dll, you can configure it according to your situation.

Keyword AddType application search, you can define the ability to execute PHP file types,

The original text reads as follows: 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 a file type that can execute PHP, such as you add a line of "addtypeapplication/x-httpd-php. htm", the. htm file can also execute PHP program, you can even add the previous line " addtypeapplication/x-httpd-php. txt ", so that ordinary text txt can also run the PHP program.

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.