Eclipse development PHP environment configuration

Source: Internet
Author: User
Tags php debug
Eclipse development PHP environment configuration First prepare the software: 1. apache: Find the latest version 2.php here and download it 3. eclipseIDEforJavaEEDevelopers, here to download 4. DLTKCoreFrameworks1.0Integrationbuild, download here note: DLTK is the PHP environment configuration for Eclipse development
Eclipse development PHP environment configuration

First, prepare the software:

1. Apache. find the latest version here.

2. Download PHP from here

3. Eclipse IDE for Java EE Developers, download it here

4. DLTK Core Frameworks 1.0 Integration build, download it here

Note: DLTK is a dynamic language development kit. PDT depends on it. I wonder why the stable version on the official homepage has dropped from 1.0 to 0.95, and PDT must be running on 1.0, select the latest Integration version (at the bottom of the page) instead of the Release or Stable version.

5. download PDT 2.0 from here

6. Zend Debugger. download it here.

?

Install and configure the software.

First, install and configure the Apache and php environments.

Not to mention installation. Apache is an msi file, and php only needs to be decompressed.

Configuration is annoying. The steps are as follows:

1. edit php. ini

? 1) extension_dir = "./"??? Change to extension_dir = "C:/php-5.2.6/ext"
? 2); extension = php_mysql.dll "and"; extension = php_gd2.dll ", remove the semicolon above, and change extension = php_mysql.dll to extension = php_mysql.dll.
Change; extension = php_gd2.dll to extension = php_gd2.dll
? 3) save php. ini and restart apache.

2. modify httpd. conf in Apache/conf and add the following content 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
Adddefacharcharset UTF8

PHPIniDir "C:/php-5.2.6"

?

3. add the following in the Path setting of the environment variable:

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

?

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

?

Code

Remember to restart Apache.

Open IE and enter http: // localhost/index. php in the address bar. if it works, php and apache will work.

?

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

1. install Eclipse. decompress it to a directory.

2. install DLTK.

Extract 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 extract directory and install it.

3. install PDT2.0

The installation of the root DLTK is similar.

4. install ZDebugger

The result of explain is as follows:

1 )? Select ZendDebugger. dll from the 5_2_x_comp Directory, copy to C: \ php-5.2.6 \ ext

2 )? Add the following in the php. ini file:

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.

5. configure Eclipse and Apache

1) configure Apache:

For example, if I place all Eclipse projects under E: \ EclipseWorkspace, modify Apache/conf/httpd. conf and add the following at the end of the file:

Alias/Workspace/"E:/EclipseWorkspace /"

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

The advantage of doing so is that all php projects share an apache configuration (see how to set it below ).

2) configure Eclipse:

Open Eclipse-> Window-> Preferences-> PHP:

Set PHP Executables-> Add as follows:

?

? Set PHP Servers-> New as follows:

?

? Note that the Workspace is added to the URL bar. this is the directory alias added in httpd. conf.

PHP Debug, as shown in, select the appropriate Debugger and Server

?

? So far, the configuration is complete.

? Remember to restart Apache again.

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

Create a new PHP Project named FirstPHPTest. of course, we use E: \ EclipseWorkspace as the Eclipse workspace directory.

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, the following figure is displayed:

?

?

Let's take a rest.

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.