Build a PHP development environment in eclipse with the PHPEclipse plugin

Source: Internet
Author: User
Tags php development environment php web development

PHPEclipse is a plug-in for eclipse that provides an integrated development environment that includes PHP parsing, running, debugging, and more. 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 usually need to do both Java and PHP Web development at the same time. The installation and related configuration of phpeclipse are described in detail below.

First Stage: PHPEclipse installation

1th Step: Baidu Search PHPEclipse, enter 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 phpeclipse download page, start the download


3rd step: After extracting the downloaded files, the contents of the discovery include: two folders features and plugins, an XML file Site.xml.

Copy the contents of features and plugins to the appropriate folder in Eclipse, and copy the Site.xml to the root of eclipse. Then start eclipse


4th step: Add PHP View in eclipse: Select Window>>open perspective>>other ... to open the View Selection window. In the Open perspective window, find the PHP option and double-click


5th step: Once added, you will see the "PHP" view option in the upper right corner of Eclipse, click the button to switch eclipse to PHP view.


6th step: Select "Window>>preferences" in Eclipse, then click "phpeclipse>>php External Tools" in the pop-up Preferences window from the left menu bar. , modify the PHP configuration information.

Php:

C:\xampp\php\php.exe

C:\xampp\php\php.exe-l-F {0}

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

Apache:

C:\xampp\apache\bin\httpd.exe

C:\xampp\apache\conf\httpd.conf

C:\Windows\System32\drivers\etc\hosts


Mysql:

C:\Program Files (x86) \mysql\mysql Server 5.1\bin\mysqld.exe


Xampp:

C:\xampp\xampp_start.exe

C:\xampp\xampp_stop.exe

(PS: The specific path is based on your own computer)


The second stage: the basic use method of PHPEclipse

1th Step: New PHP Project: Hello World


2nd step: In the newly created Hello World project, create a new PHP file: index.php


4th step: In index.php, write a test case:

echo "Hello World";


The 5th step: Apache installed with XAMPP The default file access path is "C:/xampp/htdocs" (drive letter, etc., whichever is your own configuration). To run PHP files 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 to change it to the workspace path for Eclipse.

DocumentRoot "C:\Users\admin\workspace"
<directory "C:\Users\admin\workspace" >


6th step: Select the Hello World project and the right mouse button to select the "Properties" option. Then select PHP Properties Settings, modify the project URI value, the default value is http://localhost/, and add the project name later. This allows you to navigate to the project when you run the PHP file


7th step: Click on the "Start XAMPP" icon to start the XAMPP. The XAMPP automatically launches components such as Apache. Similarly, turn off features like Apache and click on the "Stop XAMPP" icon.


8th step: Run the php file. Select index.php, and right-click on "Open php Browser" To see how the index.php works in the browser.

This article is from the "Zifangsky" blog, make sure to keep this source http://983836259.blog.51cto.com/7311475/1649721

Build a PHP development environment in eclipse with the PHPEclipse plugin

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.