# Running PHP Scripts Remotely

This procedure describes how to run files in your workspace using your server's debugger. Use this function if you want to test the execution of the file in 'real time' on the production server. This is especially relevant if your server has loaded extensions.

#### Note:

Your server must be running the XDebug or Zend Debugger in order for remote debugging capabilities to function.

To remotely run a PHP Script:

1. Click the arrow next to the Run button on the toolbar and select Run Configurations -or- go to Run | Run Configurations. A Run dialog will open.
2. Double-click the PHP Script option to create a new run configuration.
   1. Enter a name for the new configuration.
3. Select the PHP Web Server option under the Debugger Location category.
4. Select your server from the list. If you have not yet configured your server, click the underlined 'PHP Servers' shortcut. The Servers preferences page will open. Configure your server by following the instructions on 'adding a new server' under the PHP Servers Preferences page. For more information on configuring the communication between PDT and your remote server, see Setting Up Remote Debugging.
5. Under the PHP File category, click Browse and select your file.
6. If necessary, you can add arguments in the PHP Script Arguments tab to simulate command line inputs.
7. Click Apply and then Run.

Your script will be run and displayed in a browser.

#### Note:

If the file contains 'include' or 'require' calls to files which are not contained within the project, you must add them to the project's Include Path in order to simulate your production environment. In addition, if a file defined with an absolute path to a server location (See 'Include Paths' for more on absolute file locations) is called, a Path Mapping dialog will appear. See Path Mapping for more information.

#### Related Links:

- Running
- Running Files and Applications
- Running PHP Scripts Locally
- Running PHP Web Pages
- Using the Debugger
- Setting Up Remote Debugging