Build a PHP environment in Windows

Source: Internet
Author: User
: This article mainly introduces how to build a PHP environment in Windows. For more information about PHP tutorials, see. Download and configure php

Php: http://windows.php.net/download/ download
In this example, the PHP version used is the php-5.6.11

1. process dll files
Copy all dll files in the php-5.6.11 folder (remember, all, all dll files in all folders) to the system's System32 folder, similar to C: Windows \ System32 \. Alternatively, you can specify the system environment variable to add the PATH variable to the folder where php5 is located. however, to be simple, you can copy the dll file directly to the windows system directory.

II. rename
Rename php. ini-development under the php-5.6.11 folder to php. ini. Php. ini is the configuration file of php5. you can configure various php features in php. ini later.

3. configure various php features
Find a format similar to the following in php. ini:

; Extension = php_bz2.dll

In the preceding configuration, ";" indicates that the configuration is invalid. Therefore, remove ";" before the configuration item:

Extension = php_bz2.dll
Extension = php_curl.dll
Extension = php_fileinfo.dll
Extension = php_gd2.dll
Extension = php_gettext.dll
Extension = php_gmp.dll
Extension = php_intl.dll
Extension = php_imap.dll
Extension = php_interbase.dll
Extension = php_ldap.dll
Extension = php_mbstring.dll

For example, extension = php_gd2.dll indicates that PHP is enabled to support the GD2 Image Library. If you want to enable support for mysql and sqlite, extension = php_pdo_mysql.dll,
Extension = php_pdo_sqlite.dll and extension = php_mysql.dll must be enabled.

IV. set the extended support Directory

Manually set the extension directory in the php. ini file (directly add the extension directory ):

Extensi/php/ext"
Xxx indicates the php file directory.

5. support for PHP parsing

Add the following configuration to the apache configuration file httpd. conf:

# Load apache into the php processing module
LoadModule php5_module, "xxx/php-5.6.11/php5apache2_4.dll"
# Phpinidir: this is an INI file used to know php. This file is used for some php configurations.
PHPIniDir "xxx/php-5.6.11"
# This configuration indicates that when the extension of a resource is php, php will handle it.
AddType application/x-httpd-php. php

Where xxx represents the folder directory where the php-5.6.11 is located, specify as appropriate

Test PHP support

In the htdocs folder of the apache server (or another directory, which is the working directory of apache anyway), create a php file and type the following code:

Then, save the file as test. php: enter http: // 127.0.0.1 // test in the address bar of the browser. php or http: // localhost/test. php accesses. if the PHP system information is displayed, the PHP environment configuration is successful. Otherwise, you have an error in the above link and re-check each link, to complete the configuration.

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

The above describes how to build a PHP environment in Windows, including some content, and hope to help those who are interested in the PHP Tutorial.

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.