Eclipse's PHP plug-in phpeclipse installation and use ____php

Source: Internet
Author: User
Tags php web development
PHP has a lot of pretty good development tools, such as Zend Studio, NetBeans, Phpdesigner, and so on, but for the programmers of Java programming, the most common is eclipse. So can eclipse be used for PHP development? The answer is "must drop".

PHPEclipse is an Eclipse plug-in that provides an integrated development environment that includes PHP syntax analysis, running, debugging, and more. It is based on Eclipse's plug-in mechanism, Plug and Play, configuration and use are very convenient. PHPEclipse is a good choice if you need to do Java and PHP Web development at the same time. The installation and related configuration of phpeclipse is described in detail below (note: The PHP environment was previously built with XAMPP).

First stage: PHPEclipse installation

1th Step: Baidu Search PHPEclipse, click "PHPEclipse" into PHPEclipse's official website.

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

3rd Step: Here is the download of Phpeclipse-1.2.3.200910091456prd-bin.zip compressed files, after the decompression, the discovery content includes: Two folders features and plugins, an XML file Site.xml.

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

5th step: As shown in the picture, select "Window>>open perspective>>other ..." In turn, and open the View Selection window.

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

7th step: After you add a success, you will see the view options for "PHP" in the upper-right corner of Eclipse, and click the button to switch eclipse to PHP view.

8th step: Select "Window>>preferences" in Eclipse, click "phpeclipse>>php External Tools" from the left 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 submenus: Apache, MySQL, XAMPP, to set up Apache, MySQL, XAMPP configuration information.

9th step: Click on "Apache" submenu, modify Apache configuration information. Modifies the Apache path to the native installation path. Modify the sample such as the figure, the specific value of their own computer.

10th step: Modify the MySQL configuration information, modify the sample, such as the figure shown, the specific value of their own computer to prevail.

11th Step: Modify the XAMPP configuration information, modify the sample, such as the figure shown, the specific value of their own computer to prevail. After the modification, click "OK" to save the modified content.

The second stage: the basic use method of PHPEclipse

Step 1th: Switch eclipse to PHP view and select "File>>new>>php Project" to create a new PHP project. In the New phpproject window, enter the project name (project name) and select the Project save location (you can use the Eclipse default workspace, using the location, or you can specify a storage location). When finished, click Finish to finish.

Step 2nd: Select the Hello World project you just established, right-click and select "New>>php File" in the pop-up shortcut menu.

3rd step: In the New pop-up window, enter the PHP file name, such as index.php, and then click Finish.

Step 4th: Open the newly created index.php page and add an output statement between the <?php?> tag, as shown in the figure.

Step 5th: Use XAMPP to install the Apache default file access path is "C:/xampp/htdocs" (disk character, etc., whichever is its own configuration). To run a php file in eclipse, you need to modify the Apache file access path. The practice is to modify the DocumentRoot and directory values in the httpd.conf file under apache\conf and change it to the workspace path for Eclipse.

6th step: Select Hello World Project, right mouse click, select "Properties" option in the menu that pops up. Modify the value of the project URI by selecting "PHP Properties Settings" in the left menu bar of the pop-up Properties window. The default value is http://localhost/, and the project name is added later. This will enable you to properly navigate to the project when you run the PHP file.

7th step: Click the "Start XAMPP" icon, start XAMPP. XAMPP will automatically launch components such as Apache. Similarly, turn off Apache and other functions, click the "Stop XAMPP" icon.

Step 8th: Run the PHP file. Here, for example, Hello world\index.php. Select index.php, right-click, select "Open php Browser", you can see the index.php in the browser running effect.

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.