Running PHP Web Pages

This procedure describes how to run whole applications, projects, files or collections of files that are on the server. Using this process, you can run either copies of the files which are located on the server or the files located locally on your workspace (if available).

Note:

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 run a PHP Web Page:

  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 Web Page option to create a new run configuration.

 

New Run Configuration

  1. Enter a name for the new configuration.

  2. Select the Server Debugger to be used (by default this will be the Zend Debugger) .

  3. Select your server from the PHP Server list.
    If you have not yet configured your server, click New.
    The PHP Server Creation Wizard 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. To check whether your server connection is correctly configured and that Zend Studio can communicate with your server debugger, click the 'Test Debugger' button.

  5. Under PHP File, click Browse and select the file which you would like to run.

  6. The URL to be run will have been automatically created based on the file name and your server address. If the URL does not point to the file's location, unmark the Auto Generate checkbox and modify the URL.

Note:

The file to be run needs to exist on the server even if you are going to be selecting to run the local copy of your files.

  1. For further options, select the Advanced tab.

New Run Configuration - Advanced

 

  1. Under the Source Location category you can choose whether the content of the files to be run will be taken from the server or from your workspace.
    If a local copy is not available, files will be taken from the server. Selecting the 'Local Copy' option will result in the Path Mapping mechanism being applied when files are called. See the Path Mapping topic for more details.

Note:

The file to be run needs to exist on the server even if you are going to be selecting to run the local copy of your files.

  1. Click Apply and Run.

Your application 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.