Use eclipse to develop php

Source: Internet
Author: User

1. Install the php Environment

Eclipse supports PHP automatic prompts

In fact, if you have installed the php environment (see the installation process), you only need to perform the following two steps. Hoho, very simple.

1. Download the php plug-in phpeclipse from eclipse.

Address: http://www.phpeclipse.de/tiki-view_articles.php

Http://prdownloads.sourceforge.net/phpeclipse/PHPEclipse1.1.3-2005-01-29.zip? Use_mirror = jaist

2. decompress the package. Copy the content in the plugins folder to the eclipse \ plugins folder, and copy the content in the features folder to the eclipse \ features folder.

Use the Eclipse environment to write PHP programs. The following is a detailed description. If you have basic knowledge, you can skip it.

Brief Introduction:

Eclipse, a well-known open-source software and IDE, is widely used in Java development.

After the corresponding plug-ins are added, most programming languages are supported.

Prerequisites:

The AMP (A = Apache, M = Mysql, P = PHP) environment has been correctly set up and installed. The operating system platform is not limited.

Download:

Eclipse3.0.1: http://www.eclipse.org/downloads/index.php

(Select the appropriate version suitable for your system, including windows, linux, and max. We recommend that you select the latest version 3.0.1)

PHPeclipse plug-in: http://sourceforge.net/project/showfiles.php? Group_id = 57621

(Same as above, latest version 1.1.2)

Installation:

Green software, no installation required

Unbind the downloaded Eclipse package and place it in the frequently used Installation Software folder (do not start Eclipse immediately)

Unzip the PHPeclipse plug-in (the downloaded package contains two folders: features and plugins, which are the same as those under the Eclipse directory) to the corresponding Eclipse directory.

Note:

If Eclipse has been installed in advance or started before the unpressurization plug-in, because it scans all xml files and caches them for the first startup, PHP plug-in will not be recognized immediately. You need to use option-clean to force the startup once. (In winmode, you can directly access the eclipsedirectory and then eclipse.exe-clean. This applies to other platforms)

Configuration:

1. Eclipse is relatively slow to start. It may take several seconds on a machine with better hardware configuration. Please wait. The first startup will allow you to select the working directory (workspace), and you will not ask again next time after setting a check.

2. Specify a directory for storing PHP projects. If you do not specify the directory, it is in the workspace subdirectory by default. You 'd better think of the name in advance, such as my: workspace/phpeclipse

3. Modify the httpd. conf file and create a new Alias pointing to workspace/phpeclipse (Alias) --- PHP installation. My name is phpeclipse. Of course, this step can be omitted if you put the PHP project under DocumentRoot.

4. After this startup, you will find some additional items in the menu and toolbar (if you have used Eclipse before, haha)

In Window-Preferences-PHPeclipse Web Development-PHP, specify the corresponding locations of the three execution files Apache, PHP, and mysql in your php environment. As for the parameter, it seems that the default value is enough, I used Apache2, modified it, and started it with-w-n "Apache2"-k start; stopped with:-w-n "Apache2"-k stop; restart with-w-n "Apache2"-k restart

In this way, you can use the apache and mysql buttons on the toolbar.

Usage:

Choose menu> new> Project> PHP Project and specify a name. Then, you can use it. However, pay attention to the corresponding alias. Otherwise, you cannot access

Right-click the project name in the Navigator bar, create a new php file, and save the file. Eclipse automatically opens the web browser and displays the result. Pretty good. It mainly focuses on its convenience of integrated development, code block scaling, Automatic completion, and many other features.

For more details about how to add the PHP plug-in to Eclipse, refer to this article (English ):

Http://www.phpbuilder.com/columns/c...921.php3? Page = 1

PHPeclipse plug-in home page in http://phpeclipse.de/, installation if there is a problem or need more detailed documentation can go to the above to find.

Automatic prompt:

1. Open the Window of Eclipse-> Preferences-> PHPeclipse-> PHP-> CoDe Assist open the Enable auto activation option in it. There is an Auto activation triggers for PHP, and the default value is "$>". Change it as needed, for example, change it to aaaa, and then Apply, OK.

2. Export the current preference configuration File: Open Eclipse's File-> Export, expand General-> Perferences --> Export all in the window, and then click NEXT. Click "Browse" to select any path, save the configuration file, and click "Finish ".

3. use NotePad to open the saved configuration file (extension file name :*. epf), press "ctrl + F", and enter "aaaa", followed by the string "content?autoactivationtriggersphp" (or possibly content_assist_autoactivation_triggers_php. Change "aaaa" (this is the value just entered, that is, the value after =) to "$:>. abcdefghijklmnopqrstuvwxyz ("(the Code prompts automatically after all the symbols are entered in the code, because Eclipse allows only four custom characters by default, so this can bypass this restriction ), save and exit notepad.

4. re-import the modified preference configuration File: Open the Eclipse File-> ImpIn the open window, expand General-> Perferences, click NEXT, select the modified configuration file, and Finish.

5. Restart Eclipse.

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.