October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

How to Run a PHP Project in Eclipse (CLI Scripts and Web Apps)

Eclipse runs PHP through PDT: a CLI configuration for scripts and a PHP Web Page configuration with a server for web apps. Here are the steps for each.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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

  1. Choose File → New → PHP Project and name it.
  2. 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Step 3: Run a local script (CLI)

Configure the PHP executable

  1. Install PHP for your operating system and note the path to its php executable.
  2. In Eclipse, open Window → Preferences → PHP → PHP Executables.
  3. Add the executable by its filesystem path. Pick an associated php.ini if 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

  1. Create or select a PHP CLI Application run configuration for your file, then run it. The output appears in Eclipse’s Console.
  2. To debug, set a breakpoint and use a PHP CLI Application debug configuration, as the Quick Start describes.

Step 4: Run a web application

  1. Open Run → Run Configurations and create a PHP Web Page configuration.
  2. Select or create the PHP server entry. If you plan to debug, choose the server debugger as well.
  3. Choose the PHP file to launch.
  4. Check the generated URL and edit it if your project’s URL layout differs.
  5. 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.

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.Support on Ko-Fi

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.”

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.