PHP installs Eclipse and uses

Source: Internet
Author: User
Tags php web development

PHP has a lot of pretty good development tools, such as Zend Studio, NetBeans, Phpdesigner, etc., but for programmers who are accustomed to Java programming, the most often used is eclipse.

So can eclipse be used for PHP development? The answer is "must drop".

PHPEclipse is a plug-in for eclipse that provides an integrated development environment that includes PHP parsing, execution, debugging, and more. It is plug-and-play based on Eclipse's plug-in mechanism. It is easy to configure and use.

Suppose you need to do Java and PHP Web development at the same time. PHPEclipse is a good choice. The following details the installation and configuration of the PHPEclipse (note: The PHP environment was previously built with XAMPP).

First stage: PHP installation eclipse

1th Step: Baidu Search PHPEclipse, click "PHPEclipse" to enter the official webpage of PHPEclipse.

2nd step: Click on the right side of the page "Getting phpeclipse>>binary&source>> 1.2.3 Binary Download", Jump to phpeclipse download page, Select the download file save location and start the download.


The 3rd step: Download Here is the Phpeclipse-1.2.3.200910091456prd-bin.zip compressed file, after decompression. Found content contains: two directories features and plugins, an XML file Site.xml.


4th step: Copy the contents of features and plugins to the corresponding folder in Eclipse, and copy the Site.xml to the root folder of Eclipse. Then start eclipse (assuming eclipse is started, restart Eclipse for the newly added file to take effect).

5th step: What you see, select Window>>open perspective>>other ... to open the View selection form.



6th step: In the "Open Perspective" (View selection) Form, find the "PHP" option and double-click to add a PHP view to eclipse.


7th step: After the success, you will see the "PHP" view option in the upper right corner of Eclipse, click button to switch Eclipse to PHP view.



8th step: Select "Window>>preferences" in Eclipse, then click "phpeclipse>>php External Tools" in the left-hand menu bar of the pop-up Preferences form. , change the PHP configuration information.

At the same time. We found that "PHP External Tools" includes three sub-menus: Apache, MySQL, XAMPP, to set the configuration information for Apache, MySQL, XAMPP.



9th step: Click on the "Apache" submenu. Change Apache configuration information.

Change the Apache path to a native installation path.

Changes to the sample than seen, the detailed value of their own computer-based.


10th Step: Change the MySQL configuration information. Change the sample than you see. The detailed values are based on your own computer.


11th Step: Change the XAMPP configuration information, change the sample than seen, the detailed value of their own computer-based. Click "OK" to save the changes when you are done.

The second stage: The basic usage of phpeclipse

1th Step: Switch Eclipse to PHP view and select File>>new>>php Project to create a new phpproject. Enter the project name (project name) in the New phpproject form. Select the project save location (which allows you to use the Eclipse default workspace "Using default location", or you can specify storage locations separately). When finished, click "Finish" to finish.


2nd step: Select the hello worldproject that you just established, right-click. Select "New>>php File" from the Popup shortcut menu.


3rd Step: In the new form that pops up, enter the PHP file name, such as index.php. Then click "Finish".


4th step: Open the newly-created index.php page, in <

PHP?> tags are added between the output statements that you see.


5th step: Using XAMPP installed apache default file access path is "C:/xampp/htdocs" (drive letter, etc., whichever is your own configuration). To execute PHP files in eclipse, you need to change the Apache file access path.

The detailed approach is to change the DocumentRoot and directory values in the httpd.conf file under apache\conf and change it to Eclipse's workspace path.


6th: select Hello worldproject. Right-click to select the "Properties" option in the pop-up menu.

Change the value of the project URI by selecting PHP Properties Settings in the left-hand menu bar of the pop-up properties form. The default value is http://localhost/, and the project name is added later.

This allows you to navigate to the project correctly when you execute the PHP file.


7th step: Click on the" Start XAMPP "icon. Start XAMPP.

Xampp will initiate the components such as Apache on its own initiative. Similarly, turn off features like Apache. Click on the "Stop XAMPP" icon.


8th step: Execute PHP file. Here is an example of Hello world\index.php. Select index.php, right-click. Select "Open PHP Browser", you can see the index.php in the browser execution effect.


PHP install Eclipse and use

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.