Install and configure PHP in Windows

Source: Internet
Author: User
Install and configure PHP in Windows

Setting up a PHP-based Web server is required to install PHP. Because PHP code is publicly available, the upgrade speed is faster. Before installing PHP, you should renew it from the official website.

Video recording: Install. SWF in PHP under TM \ 01 \ lx \ Windows

To install and configure PHP in Windows, follow these steps:

(1) after successfully downloading the PHP installation package, decompress the package, as shown in figure 1.35, in the C: \ php5 directory.

(Click to view the large image). 35. files decompressed by PHP

(2) replace all. copy the dll file to the C: \ Windows \ system32 \ directory (if it is a Windows 2000 operating system, it is C: \ WINNT \ system32.

(3) change php under the C: \ php5 \ directory. copy the ini-dist file to the C: \ Windows \ directory (for Windows 2000 operating system, it is C: \ WINNT \), and then copy the php. rename ini-dist to php. ini, and open the file in notepad for editing. the specific editing method is as follows:

First, locate the row where the file register_globals = Off is located and change Off to On. The code is as follows:

register_globals = On

Locate the row where the file extension_dir = ". \" is located and change the path to "C: \ php5 \ ext ". The code is as follows:

extension_dir="C:\php5\ext"

Finally, find and locate Windows Extensions and run the following two lines of code:

 ; extension=php_gd2.dll; extension=php_mysql.dll

Remove the preceding comment (that is, the semicolon identifier) so that PHP can support GD2 function libraries and MySQL related functions. if you want PHP to support other function functions, you also need to remove the comments before the dll files related to these operation functions.

Note: The above is the general configuration of PHP. you can find more detailed configuration on the official PHP Forum. Because there are many PHP versions, php. the configuration of ini is also different. you should configure php according to the actual situation. ini file, php. the configuration information of the INI file is described in section 2.5.2.

(4) after the PHP configuration is complete, restart the Apache server, write the test. PHP file, and enter the following code:

 
     

Save the file to the webpage subdirectory under the Apache installation directory, and enter http: // 127.0.0.1/test. php in the browser. if the page shown in 1.36 is displayed, PHP configuration is successful.

(Click to view the larger image). 36 the test is successful.

Tip: the path of the installation file must follow certain objective principles. to avoid the inconvenience caused by porting programs between Windows and Linux, select D: the \ usr \ local \ php directory must match the installation directory in Linux. We recommend that you do not select a directory with spaces in the middle, such as E: \ program Files \ PHP. this will cause some unknown errors or crashes.

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.