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.
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.
|
|
|
To remotely run a PHP Script:
-
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.
-
Double-click the
PHP Script option to create a new run configuration.
-
Enter a name for
the new configuration.
-
Select the PHP
Web Server option under the Debugger Location category.
-
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.
-
Under the PHP
File category, click Browse and select your file.
-
If necessary,
you can add arguments in the PHP Script Arguments tab to simulate
command line inputs.
-
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.