PHP Eclipse PDT Debug Environment Build ____php

Source: Internet
Author: User
Tags install php php server php debugger php development environment php print php web server zend


The environment used in this post is: Win7 + PHP Version 5.2.17 thread safe +apache 2.2 + Zend Eclipse PDT +Studio Web debugger

has been doing a Java EE, the company recently to use PHP, want to build their own PHP development environment, how to resist the people around no familiar ...

Can only do their own clothing, which encountered a lot of difficulties, so I thought this PHP is not the most popular web development language, how to configure

So difficult, I think the most difficult is the Eclipse +xdebug +zend debugger +php They all have n versions, can combine the unified

The version is very difficult, although there are more than n tutorials on the internet, but after looking at it and their own installed is not the same.

So I decided to make this environment a must write a post to share with you.


PHP + Apache Installation method Please refer to the previous article

http://blog.csdn.net/gaochh01/article/details/6949178

Here we focus on the debug environment of Eclipse

1. Download ECLIPSEPDT First, here is a download address that integrates all the components that PHP needs, and with it you don't have to bother to go down to eclipse and find the corresponding PHP plugin,

It integrates all the plug-ins that PHP uses, please see the link below

Http://www.zend.com/en/community/pdt/downloads

Find the Windows version of the Download tab page and you need to download 1.    Zend Eclipse PDT PDT 3.0.2 w/eclipse Indigo

2.Studio Web Debugger


Extract Eclipse-php-3.0.2.v20120511142-win32.zip separately

and Zenddebugger-20110410-cygwin_nt-i386.zip

You will find that under zenddebugger-20110410-cygwin_nt-i386 there are n folders, 4_3_x_comp,4_4_x_comp ... , this is to choose

Which one is good. Don't worry, first we install PHP version 5.2.17 thread safe versions of PHP, so we chose the 5_2_x_comp folder

Content, you have to ask 5_2_x_nts_comp what this is for, I'll tell you the difference.

5_2_x_comp is for the thread safe version of PHP

5_2_x_nts_comp is for non-thread-safe version of PHP because we're loaded with PHP version 5.2.17 thread safe, so we use 5_2_x_comp

Open 5_2_x_comp, there's a ZendDebugger.dll file.

1. copy ZendDebugger.dll to [your PHP path]/ext/For example My path is: C:\Web\php\ext

2). Open the php.ini file at the end Plus

[Zend Debugger]
Zend_extension_ts= "C:\Web\php\ext\ZendDebugger.dll"; the same attention to TS and full path. Here to write your own PHP installation path
zend_debugger.allow_hosts=127.0.0.1 the host IP that allows debugging,
Zend_debugger.expose_remotely=always;

3. Open the apache/conf/httpd.conf file, add around 356 lines

alias/pdt/"d:/workspace3.3_php/"
<directory "d:/workspace3.3_php/" >
Options Indexes followsymlinks MultiViews
AllowOverride All
Order Deny,allow
Allow from all
</Directory>

You're going to ask again what this is about.

Where d:/workspace3.3_php/is your eclipse's working directory, presumably meaning that if you ask PDT, it will turn to d:/workspace3.3_php/, which may not be accurate.

But it means the same.

After restarting Apache, you can directly access the d:/workspace3.3_php/file in the Eclipse project directly via http://localhost/pdt/, which will be used 4later. Copy C:\Web\ dummy.php in PHP pdt\zenddebugger-20110410-cygwin_nt-i386 to Appache/conf/htdocs folder


Restart the Apache service

If you see in Phpinfo ()

Zend Debugger

Passive Mode Timeout Seconds

Local
DirectiveValue Master Value
Zend_debugger.allow_hosts 127.0.0.1 127.0.0.1
Zend_debugger.allow_tunnel No value No value
Zend_debugger.deny_hosts No value No value
zend_debugger.expose_remotely Always Always
Zend_debugger.httpd_uid -1 -1
Zend_debugger.max_msg_size 2097152 2097152
Zend_debugger.tunnel_max_port 65535 65535
Zend_debugger.tunnel_min_port 1024 1024

Well, congratulations, it's half done.

, Next we open Eclipse PDT, and of course our workspace is the d:/workspace3.3_php/in the Apache httpd.conf configuration


1. Windows----> Preference---> PHP----->php executables----------->add

Name:test this casual

Exceutable Path:c:\web\php\php.exe your own PHP installation path

PHP ini File:c:\web\php\php.ini your own PHP installation path

SAPI TYPE:CLI

PHP Debugger:zend Debugger

Then confirm the Save

2. Windows----> Preference---> PHP---------> PHP Servers

Name:default PHP Web Server at random

Base url:http://127.0.0.1

Local WEB Root: null

Then confirm the Save

3. Windows----> Preference---> PHP------------->debug

PHP Debugger:zend Debugger

Server:default PHP Web Server (configured in 2)

PHP excutable:test (configured in 1)

4). Enable CLI Debug Front hook hit

Then confirm the Save


5). Create a new PHP project Name:test

Create a new PHP file new.php

Input: <?php print ("Hello world!"); ?>

6): Click on the Debug Configuration----------->php Web application

Double-click to create a new configration Name: Random

Server

Debugger:zend Debugger

PHP server:default php Web Server (created in the previous step)

File: Check/test/new.php

URL under the auto Generate front of the hook to remove

URL:HTTP://127.0.0.1//pdt/test/new.php This place attention to modify

Why do you have to add PDT? , because we were in apache/conf/httpd.conf before

alias/pdt/"d:/workspace3.3_php/"
<directory "d:/workspace3.3_php/" >
Options Indexes followsymlinks MultiViews
AllowOverride All
Order Deny,allow
Allow from all
</Directory>

If you don't add PDT, the default request is the file in the C:\Web\apache\htdocs directory, you will be prompted not to find

/test/new.php, so you know why you're adding ptd?

Then click Debug and you can debug the new.php in the same way as you debug java.

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.