Eclipse Development PHP Environment Configuration _php Tutorial

Source: Internet
Author: User
Tags php debug
First, prepare the software.

1. Apache, find a new version here

2. PHP, Download here

3. Eclipse IDE for Java EE developers, download here

4. DLTK Core Frameworks 1.0 integration build, download here

Note: DLTK is the so-called Dynamic language development package, PDT relies on it, For some reason now the stable version on the official homepage has dropped from 1.0 to 0.95, and PDT must be running on 1.0, so please select the latest integration version (at the bottom of the page) instead of release or stable version.

5. PDT 2.0, Download here

6. Zend Debugger, Download here

Configure these software to begin installation below.

First, install the configuration Apache and PHP environments.

Install not much said, Apache is an MSI file, PHP as long as the decompression can be.

Configuration is more annoying, the steps are as follows:

1. Edit PHP.ini

1) Extension_dir = "./" modified to Extension_dir = "C:/php-5.2.6/ext"
2); Extension=php_mysql.dll "and"; Extension=php_gd2.dll ", remove the preceding semicolon, that is, extension=php_mysql.dll change to Extension=php_ Mysql.dll
Change the Extension=php_gd2.dll to Extension=php_gd2.dll.
3). Save the php.ini and then re-start Apache

2. Modify the httpd.conf under apache/conf and add it at the end of the file:

LoadModule php5_module "C:/php-5.2.6/php5apache2_2.dll"
AddType application/x-httpd-php. php
AddType Application/x-httpd-php-source. Phps
Action application/x-httpd-php "/php/php-cgi.exe"
AddType application/x-httpd-php. html
AddType application/x-httpd-php. htm
Adddefaultcharset UTF8

Phpinidir "c:/php-5.2.6"

3. Under the path setting for the environment variable, add:

C:\php-5.2.6; C:\php-5.2.6\ext

After the above configuration, create a PHP test file under the Apache/htdocs directory index.php as follows:

Php

phpinfo ();
?>

Remember to restart Apache.

Open IE in the address bar input: http://www.BkJia.com/index.php, if you can work means that PHP and Apache can work.

Then, configure the PHP development for Eclipse and debug the environment.

1. Install eclipse. Just unzip to a directory

2. Install the DLTK.

Unzip the downloaded file to a directory, such as: F: "PHP" PDT "dltk-core-i-i200809081043-200809081043-incubation, start Eclipse->help->software Updates->available software, Add Site, Local, select the unzip directory that you just installed.

3. Installing PDT2.0

The root DLTK installation is similar.

4. Installing Zdebugger

Download to the Zenddebugger-5.2.14rc9-cygwin_nt-i386.zip extract, the directory has a Readme.txt, according to the installation on the line, according to the actual situation I installed Readme.txt results are as follows:

1) Select Zenddebugger.dll,copy below C:\php-5.2.6\ext from the 5_2_x_comp directory

2) in the php.ini file, add:

Zend_extension_ts=c:/php-5.2.6/ext/zenddebugger.dll
zend_debugger.allow_hosts=localhost,127.0.0.1

Zend_debugger.expose_remotely=always

3) Copy the dummy.php file to C:\Program Files\apache software Foundation\apache2.2\htdocs below

5. Configuring Eclipse and Apache

1) Configure Apache:

For example, I put all the eclipse projects under E:\EclipseWorkspace, then modify the apache/conf/httpd.conf and add it at the end of the file:

alias/workspace/"e:/eclipseworkspace/"

Options Indexes MultiViews
AllowOverride None
Order Allow,deny
Allow from all

The advantage of this is that all PHP projects share an Apache configuration (see how to set it below).

2) Configure eclipse:

Open eclipse->window->preferences->php:

PHP Executables->add, set up as follows:

PHP Servers->new, set up as follows:

Note that workspace is added to the URL bar, which is the directory alias added in httpd.conf.

PHP Debug, as shown, select the appropriate debugger,server

At this point, the configuration is complete.

Remember to restart Apache again.

Finally, build a test program to see how it works:

Create a new PHP project named Firstphptest, of course, using our E:\EclipseWorkspace as the workspace directory for Eclipse.

Create a new PHP File in the project, such as using the index.php above.

When you right-click Run as->php Web page on index.php, you can see something like this:

Here we go, rest, take a break.


Author Sayo.net

http://www.bkjia.com/PHPjc/478524.html www.bkjia.com true http://www.bkjia.com/PHPjc/478524.html techarticle First, prepare the software: 1. Apache, find here the latest version of 2. PHP, download the 3 here. Eclipse IDE for Java EE developers, download here 4. DLTK Core Frameworks 1.0 Integrat ...

  • Related Article

    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.