Running PHP Scripts Remotely

This procedure describes how to run files in your workspace using your server's Zend 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.


Your server must be running the Zend Debugger or Xdebug in order for remote debugging and profiling capabilities to function.
The Zend Debugger comes bundled with Zend Studio and Zend Server. For instructions on installing and configuring Xdebug, see Installing Xdebug and Configuring Xdebug.



Instructions on how to complete a procedure

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.

New Debug Configuration

  1. Enter a name for the new configuration.

  2. Select the PHP Web Server option under the Debugger Location category.

  3. 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 Zend Studio and your remote server, see Setting Up Remote Debugging.

  4. Under the PHP File category, click Browse and select your file.

  5. If necessary, you can add arguments in the PHP Script Arguments tab to simulate command line inputs.

  6. Click Apply and then Run.

Your script will be run and displayed in a browser.


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.