Eclipse installation Configuration Xdebug and subversion

Source: Internet
Author: User
Tags php debug php debugger php debugging tools php development environment phpinfo svn zend zend server

This is a major introduction to using XAMPP integration to install and configure Apache, MySQL, and PHP, and then use the Eclipse IDE, install configuration xdebug and subversion, and other problems that are frequently encountered in PHP development. Install XAMPP

The XAMPP installation package integrates not only the necessary parts of the PHP development environment, but also other components that are useful in other PHP development. Under Windows system XAMPP installation process is very simple, basically download after installation, detailed steps to see: Windows System Installation Configuration Xampp.

Edit php.ini configuration file

In order for XAMPP to enable PHP debugging features such as Xdebug, you must edit the php.ini file (Phpinfo () function to view the path of the file: C:\xampp\php\php.ini) To configure the associated extension.

Locate "Implicit_flush = off" and change it to "Implicit_flush = on".

Find "Zend_extension", will php_xdebug.dll the front semicolon; such as: Zend_extension = "C:\xampp\php\ext\php_xdebug.dll".
Locate the following sections, remove them separately, and change them to the configuration shown below:

xdebug.profiler_enable=1
xdebug.profiler_output_dir= "C:\xampp\tmp"
xdebug.remote_enable=true
Xdebug.remote_host=localhost
xdebug.remote_port=9000
XDEBUG.REMOTE_HANDLER=DBGP

After restarting the Apache service, look again at phpinfo () to search for "xdebug support" and the parameters that have been enable,xdebug.remote_enable have been configured correctly to indicate that the configuration was successful.

In the Ubuntu environment, you need to install Php5-xdebug to/etc/php5/conf.d/xdebug.ini the above configuration: Apt-get install Php5-xdebug. Eclipse Installation Configuration

Eclipse's PDT is an eclipse-specific plug-in for PHP development. For more detailed information, see: Ubuntu Linux installation Eclipse. To uninstall Eclipse, delete the folder directly, because the installation process is not written to the Windows registry.

First, download and install Java (JRE or JDK): http://www.java.com.

Second, download PDT:PDT has more than one version, specific download which version of it.

1. All in one PDT installation package (Zend-eclipse-php-helios-win32-x86.zip) installed under the Zend official download Windows system: Windows bit (184m-contains PHP Zend Debugger). – Use this version if you want to enable Zend debugger.

2. Download Pdt:eclipse PDT 2.2.0 All in Ones,all-in-one Windows 32-bit at the Eclipse website. (PDT in one download here does not contain debugger, and you must download additional PHP debugging tools, such as PDT and Zend Server Community Edition or Xdebug). –XAMPP has integrated with the PHP version of the Xdebug (C:\xampp\php\ext\php_xdebug.dll), so no longer to xdebug.org download. This download version is suitable for the configuration after the installation of XAMPP, which is the download version used in this article.

3. Eclipse has been installed, the PDT plugin can be installed: Open eclipse:help-> Software updates-> Find and Install, select Search for new features to instal L "Then click Next to create a remote URL: NAME:PDT;URL:HTTP://DOWNLOADS.ZEND.COM/PDT, click Next to start installing PDT.

4. Can also be installed from the Galileo upgrade site PDT 2.1, menu select help-"Install new sofeware-" Galileo Update site–http://download.eclipse.org/ releases/galileo/-"type filter Text input pdt-" programming language check PHP development tool SDK Feature

Helios or other versions, other PDT installation methods can be referred to: PDT installation

Iii. Eclipse Installation Settings workspace

Eclipse PDT has been downloaded and extracted to the target directory like the D: drive letter. After decompression Click Eclipse.exe Install Eclipse, set the default workspace, here is set to XAMPP site root directory, such as C:\xampp\htdocs.

Iv. configuring Eclipse encoding and line breaks

Project code developed under Windows systems requires a line break to be used on a Linux server. Set window-> Preferences-> general-> Select Workspace. Sets the text file encoding to Other/unix for the other/utf-8,new text file line delimiter. As shown in the following illustration:

V. Eclipse New PHP Project

Go to file->new->php Project, with two options:

Create new project in Workspace. You can first create a new PHP project in the C:\xampp\htdocs area, such as when project name is set to Farleeinfo, and a new Farleeinfo directory is created under the XAMPP root directory. To create a new PHP project for a directory that already exists within the workspace, project name must be the same as the level two directory name, and project name must also be xampp to set the XAMPP directory as a PHP project.

Create Project at existing location (from existing source), if you choose this option to create a new PHP project, your directory cannot be within the workspace, it must be a directory path outside the workspace. Otherwise, there will be similar error prompts: Create a PHP project:cannot Create project content in Workspace. The problem arises because in Eclipse, Workspace workspace and project projects are two completely independent concepts, Workspace provides a default location for new project, but the project path cannot contain the workspace in it. Projects do not necessarily have to be in workspace. You can therefore create new project under C:\xampp\htdocs, or you can build new projects under other system paths outside of C:. Eclipse Configuration Xdebug

Eclipse contains the Zend debugger xdebug two PHP debugging tools, we choose Xdebug here. So first tell eclipse to use the Xdebug:window-> preferences->php->debug->default settings->php Debugger Select Xdebug. "Break at first" is checked to indicate that PHP debugging will be paused on line one. As shown in the following illustration:

Click OK, and if the error prompts the debugger port you requested 9000 be already in, modify the Xdebug port settings and click Xdebug on the right of the Configure on the image above. Set the reset Xdebug port (debug port) in a new window for other, such as 10000. Also, in the php.ini configuration, change the xdebug.remote_port=9000 to a consistent port.

Then set the Xdebug option, and in the left tree menu above, click the Workbench options below debug to set allow multiple debug sessions as never so that only one session can be opened per debug; set switch Back to PHP Perspective time the debug is terminated automatically jumps to the PHP Code Edit view page when it terminates debugging.

Xdebug Debugging PHP files

Select the php file right-click Debug as PHP Web page, or open the php file click menu Run->debug (F11). Set click Debug to automatically jump to the PHP Debug view, setting: Window-> preferences->run/debug->perspectives-> Select PHP Web page-> "Open The associated perspective when launching "Select Always".

If the Eclipse debugging process appears: Launching:waiting for XDebug session. The pause at 57% does not move. Generally, the port is occupied by other programs, the port 10000 back to 9000, while the php.ini Xdebug.remote_port also changed back to 9000. The following figure is the toolbar for the Eclipse PHP xdebug debugging:

Resume reset, terminate terminated, step into execute call function, step over skip execution next line. Eclipse Installation Subversion (SVN) plugin subclipse

A big advantage of Eclipse is that it can be used for versioning of PHP project code, such as installing Eclipse Subversion (SVN) plug-in subclipse. In Eclipse's Help menu, choose Install New Software to open the update manager. Work with Right click Add ... Add a new available software. Enter the name casually, address location fill in the http://subclipse.tigris.org/update_1.6.x, as shown in the following figure:

Click Ok,pending ... After a while, the 3 library installation packages (Core Svnkit library, Optional JNA Library, Subclipse) are checked in a new window. 9. Then click Next->next and select I accept the terms of the license agreements. Download the related files automatically and install them, and the installation process will receive the following warning message:

"Warning:you are installing software that contains content. The authenticity or validity of this software cannot is established. Do your want to continue with the installation?

This is eclipse tip subclipse No digital signature, click OK to continue the installation. The SVN plugin subclipse prompts you to restart eclipse after the installation is complete. After you restart Eclipse, click File >Import>SVN> in the menu to find checkout Projects from SVN (checking out the project from SVN) to prove that the Subclipse plug-in was installed successfully.

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.