Eclipse runs PHP through PHP Development Tools (PDT), and “running” means one of two things. A command-line script uses a PHP CLI Application configuration and a local PHP executable. A web application uses a PHP Web Page configuration and a configured server. Installing PDT does not install PHP itself, so you need a PHP runtime either way.
Which workflow do you need?
| Workflow | Use it for | Required setup | Caveat |
|---|---|---|---|
| PHP CLI Application | Scripts that run locally with no web-server interaction | Local PHP executable configured in PDT | Not a substitute for a server when the app needs HTTP requests or responses |
| PHP Web Page | Web apps served by a local or remote server | A configured PHP server; a debugger on the server if you want to debug | The file must exist on the server; URL, include paths and path mapping may need adjusting |
Both are described in the official PDT Running documentation.
Step 1: Install or enable PDT
- New install: download the Eclipse package for PHP developers from the Eclipse PDT site. Eclipse itself needs Java, so check the requirements of the exact package you download.
- Existing Eclipse: go to Help → Install New Software, add the update site
https://download.eclipse.org/tools/pdt/updates/latest, select PDT, install, and restart if prompted.
Afterwards, confirm that the PHP perspective and the PHP Project wizard are available. The project’s release history lists PDT 8.4 as released on 2025-12-10. Check the PDT site for the current version and compatibility with your Eclipse before installing.
Step 2: Create or open the project
- Choose File → New → PHP Project and name it.
- Add a script with File → New → PHP File.
These steps come from the PDT Quick Start. That guide covers creating a project but gives no single import recipe for existing code. For an existing codebase, the simplest approach is usually a new PHP Project pointed at the existing folder. Check what the wizard offers in your version.
#1 Best Overall
Step 3: Run a local script (CLI)
Configure the PHP executable
- Install PHP for your operating system and note the path to its
phpexecutable. - In Eclipse, open Window → Preferences → PHP → PHP Executables.
- Add the executable by its filesystem path. Pick an associated
php.iniif your script needs particular settings.
The PHP Executables preferences page says: “You must configure a PHP Executable before you can debug locally.”
Run or debug the file
- Create or select a PHP CLI Application run configuration for your file, then run it. The output appears in Eclipse’s Console.
- To debug, set a breakpoint and use a PHP CLI Application debug configuration, as the Quick Start describes.
Step 4: Run a web application
- Open Run → Run Configurations and create a PHP Web Page configuration.
- Select or create the PHP server entry. If you plan to debug, choose the server debugger as well.
- Choose the PHP file to launch.
- Check the generated URL and edit it if your project’s URL layout differs.
- Run the configuration.
Per Running PHP Web Pages, the selected file must exist on the server even when you run the local workspace copy. If the project uses files outside its folder or absolute server paths, configure include paths or path mapping.
Rank #2
Pressing Run on a project will not produce a working web app unless a server and document root are set up. The server stack, framework, environment variables and database depend on your codebase, and PDT does not supply them.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Step 5: Debugging and first checks
PDT supports Xdebug and Zend Debugger. The Running documentation states: “Your server must be running the Xdebug or Zend Debugger in order for remote debugging capabilities to function.”
Quick Recap
Rank #4
- Local script won’t debug: confirm a PHP executable is configured under PHP Executables.
- Web page won’t load or debug: confirm Xdebug or Zend Debugger is active on the server and that the server and debugger connection tests successfully.
- 404 or wrong file: confirm the file exists at the server path and the run configuration’s URL points to it.
- Missing includes or classes: review include paths and path mapping.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




