Build PHP Environment under Windows

Source: Internet
Author: User
Download and configure PHP

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

One, processing DLL files
Copy all the DLL files in the php-5.6.11 folder (remember, all the DLL files in all folders) to the System32 folder of the system, similar to c:windows\system32\. Alternatively, you can specify the system environment variable to add the PhP5 folder to the path variable, but for simplicity, you can choose to copy the DLL files directly to the Windows system directory.

Second, rename
Rename the php.ini-development under the php-5.6.11 folder to PHP.ini. PHP.ini is a php5 configuration file, and you can configure PHP features in php.ini later.

Three, the configuration of various features of PHP
Find a place in php.ini similar to the following format:

; Extension=php_bz2.dll

In the above configuration, the preceding ";" indicates that the configuration is invalid, so the ";" Before the configuration item should be removed:

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

Like Extension=php_gd2.dll, let PHP turn on support for the GD2 picture library. If you want to turn on support for Mysql,sqlite, etc., then Extension=php_pdo_mysql.dll,
Extension=php_pdo_sqlite.dll,extension=php_mysql.dll to open it.

Iv. setting up the Extended Support directory

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

Extensi/php/ext "
where xxx represents the php file directory

Five, support PHP parsing

In the Apache configuration file httpd.conf, add the following configuration:

#让apache载入php处理模块
LoadModule php5_module "Xxx/php-5.6.11/php5apache2_4.dll"
#phpinidir这个是用于知道php的ini文件, this file is some configuration of PHP
Phpinidir "xxx/php-5.6.11"
#这个配置表示, when a resource has an extension of PHP, it is handled by PHP.
AddType application/x-httpd-php. php

where xxx represents the folder directory where php-5.6.11 is located, please specify according to the actual situation

Test PHP Support

In the Apache server's Htdocs folder (or another directory, anyway, is the Apache working directory), create a new PHP file, type the following code:

Next, save the file as test.php, enter in the browser address bar: http://127.0.0.1//test.php or http://localhost/test.php access, if it is the PHP system information, then, The PHP environment is configured successfully; otherwise, you are on top of which link is wrong, re-check each link to complete the configuration.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

The above describes the Windows build PHP environment, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.