How to build a PHP development environment using WinXP

Source: Internet
Author: User
Tags php development environment php editor

Set up a PHP development environment in WinXP. 1. Install the Apache server.

Address: http://httpd.apache.org/download.cgi

Download current new version: apache_2.2.13-win32-x86-openssl-0.9.8k.msi

Run the installation file directly.

In this example, the installation path is D: Program FilesApache Software FoundationApache2.2.

Build a PHP development environment using WinXP 2. install PHP

Currently, the latest stable version is PHP 5.2.11, but there is no corresponding PECL package. The 5.2.6 PECL package can still run on this version. I also selected version 5.2.6. : Http://www.php.net/releases/

Download two files: php-5.2.6-win32.zipw.pecl-5.2.6-win32.zip. The first file is The PHP interpreter, and The second is The PECL (The PHP Extension Community Library). It contains The C language code that can be compiled into The PHP Core, therefore, the PECL extension library can be compiled to be dynamically loaded. so shared library, which expands the PHP language from the underlying layer.

Decompress two compressed files, copy all dll files under the pecl-5.2.6-Win32 to the ext directory under the php-5.2.6-Win32. Then place the php-5.2.6-Win32 where you want it. The PHP core interpreter is installed successfully.

Installation path in this example: D: Program FilesPHPphp-5.2.6-Win32

You need to modify two files:

1) PHP configuration file. The PHP installation path contains two built-in files: php. ini-dist and php. ini-recommended. Modify the first file, copy the first file, and change the name to php. ini.

Modify: extension_dir, which specifies the location of the extended dll Directory. Changed to extension_dir = "D:/Program Files/PHP/php-5.2.6-Win32/ext"

Doc_root, which specifies the path of the Web server. Change to doc_root = "D:/Program Files/Apache Software Foundation/Apache2.2/htdocs"

Enable certain extensions. Some already exist, but are commented out. You only need to add the; sign before the line. If you do not know which ones you want to use, you can skip this step.

2) Apache configuration file. Add PHP to Apache configuration. Modify the httpd. conf file in the Apache installation directory and add the following statement:

LoadModule php5_module "D:/Program Files/PHP/php-5.2.6-Win32/php5apache2_2.dll"

PHPIniDir "D:/Program Files/PHP/php-5.2.6-Win32 /"

AddType application/x-httpd-php. php

Note that "D:/Program Files/PHP/php-5.2.6-Win32/php5apache2_2.dll" must use double quotation marks; otherwise, Apache cannot start the service.

Set up a PHP development environment using WinXP. 3. test and install it.

Create a test file test. php under the directory of the Apache server

File Content: <? Phpinfo ()?>

Start the server and access http: // 127.0.0.1 /. All PHP configurations are printed.

4. Install PEAR.

In the PHP Directory to run the go-pear.bat command, the installation process in a carriage return key on the line. PEAR is the official open-source PHP class library, short for PHP Extension and Application Repository. Pear indicates a Pear in English. PEAR compiles common functions in PHP program development into class libraries, covering page presentation, database access, file operations, data structures, cache operations, network protocols, and many other aspects, you can use it easily.

Build a PHP development environment using WinXP 5. Configure the environment variables and add the php installation directory to the path.

Otherwise, some functions supported by php cannot be found. For example, if you search for libmysql. dll files related to MySQL, some people will tell you to copy the file to the window directory. To solve the same problem, set the path to be more professional.

WinXP builds a PHP development environment. 6. The editor selects Zend, and Eclipse also has a dedicated PHP editor.

Zend7.0 and later began to use Eclipse plug-in technology development. The style is the same as that of Eclipse. I don't know if it is to attract a large number of Java developers.

WinXP builds a PHP Development Environment 7. If Zend is used, put the php project code in the workspace.

Php is not a programming language but a script and does not need to be compiled. Therefore, you can configure the Apache project release directory to the workspace. This makes it easy to see the results after writing the code.

Modify the DocumentRoot entry in the conf/httpd. conf file in the Apache installation directory and change it to the workspace location.


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.