How to build a PHP development environment with plugins in Eclipse

How to build a PHP development environment with plugins in Eclipse 
  I want to use Eclipse for PHP development. The PHP Development Tools (PDT), Remote System Explorer (RSE), and the svn version control plug-in Subclipse are installed in Eclipse.
  The Remote System Explorer plug-in allows you to connect directly to remote servers in Eclipse. This is a very nice plugin, you can have multiple connections to multiple servers at the same time and manage them conveniently. Also, you can use it to browse the local file system and use Eclipse as a text editor.
  The steps below were performed on Windows 7 and should work on Mac and Linux as well.

  Step 1: Download and install Eclipse
  Go to http://www.eclipse.org/download to download the Eclipse Classic 32-bit version (do not download the Eclipse PHP package), the current latest version is 3.7.2 Indigo.
  Once the download is complete, unzip and place the folder in C:\eclipse, start Eclipse Just double-click eclipse.exe in this folder and select your workspace folder.
  
  Step 2: Setting up the PDT plugin for PHP Select from
  the Eclipse menu: Help > Install New Software. This will bring you to a screen like this:

  at the top of the window, you will see a drop down menu, "work with", click and select "- All Available Sites -".
  Next search for "PHP" in the filter window, which will list the same plugin in three different categories. Just select one of the "PHP Development Tools (PDT)" and click "Next", when the installation is complete, it will ask you to restart Eclipse, click "Restart now". You now have the PHP PDT plugin installed.
  In the future, when you need to install new software, you can follow the steps here.
  
  Step 3: Install Remote Explorer
  Follow the same steps as above, search for "Remote System", click to install 'Remote System Explorer End-User Runtime' and 'Remote System Explorer User Actions'.

  
  Step 4: Configure PHP
  Eclipse 3.7 does not automatically recognize the php file type by default.
  Go to the menu Windows > Preferences select general > editors > file associations

  and click the "Add" button to add *.php.

  When you hit OK, you will see the editor list below. Click " PHP Editor " and then click the default button on the right. Then click OK

  
  Step 5: Configure Remote System Explorer (RSE)
  The first thing you need to do is add the Remote System Explorer view to your Eclipse workspace.
  Go to the menu Window > Open Perspective > Other. Select and add Remote System Explorer.

  A new tab window will now appear in the Eclipse workspace. By default you can browse and edit files on your local hard drive.

  Now comes the critical part, setting up a new connection. Click the down arrow in the "Remote Systems" tab window and select "New Connection"

  to display all connection types on the next screen. I want to connect using SSH. Therefore, select "SSH Only" and click "Next".

  On the next screen, you will need to enter your host's address.
  Now you have a new connection. In your 'Remote Systems' tab window, you will see 'My Home' and 'Root'. There are only these two file filters by default.
  If you want to add other filters, you need to right-click on "SFTP Files" and choose "New" > "Filter".

  Next, you will enter the location of the folder, such as /home/test. Select Next, give the filter a name, and click OK.
  
  Step 6: Autocompletion for PHP files in Remote System Explorer To do this, you need to edit a hidden file
  in the workspace folder . First we have to make Remote Explorer show hidden files , go to the menu Windows > Preferences, then expand Remote System > Files.   Check Show hidden files and click OK.


  Now we're going to use RSE to edit an Eclipse .project file. So open your local file in your "Remote Systems" tab window and browse to your workspace folder. Look for the folder called "RemoteSystemsTempFiles" and open it. Now you will edit the .project file. Open the file.
  You need to add the following two lines between the <natures> tags:
  <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
  <nature>org.eclipse.php.core.PHPNature</nature>

  Save file, and restart Eclipse. If everything is correct, you should now have autocomplete and it will look like this

  
  Step 7: Install the version control plugin Subclipse
  From the Eclipse menu choose: Help > Install New Software, search for Subclipse, or use http://subclipse.tigris .org/update_1.8.x as the update URL. Follow the on-screen prompts to install: Subclipse and SVNKit, there are detailed instructions here.
  Besides, I also installed a Subversion (referred to as svn) client software under Windows platform: TortaoiseSVN, which can operate the svn library through Windows Shell (Windows Explorer). For example, to check out a working copy, first create a folder for the copy, right-click on it, select from the menu: TortoiseSVN → Checkout... , enter the URL, or enter the folder address if you are using a local repository instead of a server : file:///c:/svn_repos/your_project/trunk. Click OK and that's it.
  Well, you should now have a more complete Eclipse PHP development environment. Hope you like it, and welcome to comment if you find any bugs.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324539038&siteId=291194637