Install and use PHP plug-in PHPEclipse of Eclipse

Source: Internet
Author: User
Tags netbeans
PHP has many quite good development tools, such as ZendStudio, NetBeans, and phpdesigner. But for Java programming programmers, Eclipse is the most commonly used tool. So Eclipse can be used for PHP Development

PHP has many quite good development tools, such as Zend Studio, NetBeans, and phpdesigner. But for Java programming programmers, Eclipse is the most commonly used tool. So Eclipse can be used for PHP Development

PHPEclipse is a plug-in of Eclipse. It provides an integrated development environment that includes PHP syntax analysis, running, debugging, and other functions. It is based on the Eclipse plug-in mechanism, plug-and-play, configuration and use are very convenient. PHPEclipse is a good choice if you need to develop Java and PHP Web at the same time. The following describes the installation and configuration of PHPEclipse in detail (Note: XAMPP has been used to build a PHP environment ).

Phase 1: PHPEclipse Installation

Step 2: Baidu searches for PHPEclipse and click "PHPEclipse" to go to the official PHPEclipse webpage.

Step 2: click "Getting PHPEclipse> Binary & Source> 1.2.3 Binary Download" on the right of the page to go to The PHPEclipse Download page. Select the Download file storage location and start the Download.

Step 2: Download The compressed file. After decompression, the file contains two folders: features and plugins, and an xml file site. xml.

Step 2: copy the content in features and plugins to the corresponding Eclipse folder and copy site. xml to the Eclipse root directory. Start Eclipse (if Eclipse is started, restart Eclipse to make the newly added file take effect ).

Step 2: Select "Window> Open Perspective> Other ...", Open the View Selection window.

Step 2: In the "Open Perspective" window, find the "PHP" option and double-click to add the PHP view to Eclipse.

Step 2: After the configuration is successfully added, the "PHP" view option is displayed in the top-right corner of Eclipse. click the button to switch Eclipse to the PHP view.

Step 2: Select "Window> Preferences" in Eclipse, and click "PHPeclipse> PHP External Tools" from the left-side menu bar in the pop-up Preferences Window ", modify the PHP configuration information. At the same time, we found that "PHP External Tools" contains three sub-menus: Apache, MySQL, and XAMPP, which are used to set the configuration information of Apache, MySQL, and XAMPP.

Step 2: click the "Apache" sub-menu to modify Apache configuration information. Change the Apache path to the local installation path. Modify the sample. The specific value is subject to your computer.

Step 2: Modify the MySQL configuration information. Modify the sample code. The specific value is subject to your computer.

Step 2: Modify the XAMPP configuration information, as shown in the following example. The specific value is subject to your computer. After modification, click "OK" to save the modification.

Stage 2: basic usage of PHPEclipse

Step 2: Switch Eclipse to the PHP view, and select "File> New> PHP Project" to create a PHP Project. In the "New PHPProject" window, enter the Project name and select the Project storage location (you can Use the Eclipse default workspace "Use default location" or specify the storage location separately ). Click "Finish.

Step 2: select the created Hello World project, right-click the project, and choose New> PHP File from the shortcut menu ".

Step 2: In the new window that appears, enter the php file name, such as index. php, and click "Finish ".

Step 2: Open the newly created index. php page? Php?> Add an output statement between tags ,.

Step 2: The default file access path for Apache installed with XAMPP is "C:/xampp/htdocs" (the drive letter is subject to your own configuration ). To run the PHP file in Eclipse, you must modify the Apache file access path. The specific method is to modify the DocumentRoot and Directory values in the httpd. conf file under Apache \ conf and change them to the Eclipse workspace path.

Step 2: select the Hello World project, right-click the project, and select the "Properties" option in the pop-up menu. In the pop-up Properties window, select "PHP Properties Settings" in the left-side menu bar to modify the Project URI value. The default value is, and the project name is added later. In this way, the project can be located normally only when the PHP file is running.

Step 2: click the "Start XAMPP" icon to Start XAMPP. XAMPP automatically starts components such as Apache. Similarly, to disable Apache and other functions, click the "Stop XAMPP" icon.

Step 2: run the PHP file. The following uses Hello World \ index. php as an example. Select index. php, right-click, and select "Open PHP Browser" to see the Running Effect of index. php in the Browser.

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: 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.