An Eclipse workspace is a folder which is used to store a project.
Procedure to create a workspace in Eclipse:
- While in the workspace “/var/www” select File + Switch Workspace + Other from the main menu
- Enter full pathname to the workspace folder
(e.g. /var/www/<folder-name>
This will create a new folder in /var/www. Eclipse will close and reopen that workspace. - Create a new project in the workspace
- File + New + Project (php webspace) . . .
- Enter name of the Project for this workspace
- Click Finish.
- Add content
- Select File + Import from the main menu
- In the Import dialog box, select General + File System then click Next
- Browse to the folder that contains existing code
- Click OK
- If necessary, Browse to “Into Folder”
- Click Finish
- Configure the workspace with Window + Preferences
- General + Content Types + PHP Conten Types
(add .module, etc for Drupal sites) - PHP + Code Style + Formatter
(use spaces for tab policy with indentation equal 2) - Configure Debugger
- PHP Web Page
- Use XDebug
- Use Default PHP Web Server
- In the URL section, uncheck “Auto Generate” and enter full path to start file
(include the new Workspace folder name) – e.g. http://localhost/<workspace>/<project root>/index.php