These instructions are for new installs of WebSmart 11.3 ILE, PHP (on IBM i) and Clover (or higher) only. Please log in to myBCDSoftware.com to access the New Features and Upgrade Guide as well as the User Guide. If you don't have an IBM i, use these instructions to install WebSmart PHP on your PC.
Step 10: Set up the PHP Debugger (for single or multiple users)
This is only required for WebSmart PHP installs. If you intend to develop PHP programs, you may want to use WebSmart's PHP debugger. If you will only use WebSmart ILE, you can skip this step.
- Copy the xdebug.so file to your Zend IFS directory. When you install WebSmart on the server the file xdebug.so is created in your IFS, in the folder /esdi/websmart/.
Open your IFS and copy the file xdebug.so to /usr/local/zendsvr/lib/debugger/. You will add configuration details to this file in Step 4.
Steps 2 and 3 are only required if you are setting up the PHP debugger for multiple developers. If you are setting up the debugger for a single user, continue with step 4.
- Start pydbgpproxy.exe on the proxy server machine. To run the PHP debugger for multiple developers you must set up a a thirdparty proxy server for the WebSmart IDEs to connect to. This is typically installed on a server PC that is always running.
Your WebSmart IDE installation folder includes the debug proxy server in a folder by default installed to C:\esdi\websmart\bin\pydbgpproxy\. Copy the folder pydbgpproxy to the machine you will set up as the proxy server.
Within this folder, we also include a sample batch file named pydbgpproxy.bat that makes it easier to launch the proxy server. Open a command prompt and run the sample batch file pydbgpproxy.bat. This file runs this command string:
pydbgpproxy -i :9001 -d :9000
This starts the proxy listening for Xdebug conversations from the PHP server on port 9000 and listening for WebSmart IDEs on port 9001.
- Configure WebSmart PHP's initial settings. The WebSmart PHP debugger is by default configured in the IDE for a single user. To configure the debugger for multiple users, launch the WebSmart IDE and go to the Tools/Options menu.
Select the PHP/Debugging section to present these options:
For multi-user debugging configuration, these values are important:
Debugger IDE key The IDE key can be anything, as long as it is unique for each IDE that is connecting to the proxy server. Use Proxy Server Check this option to use a proxy server for the debugger, to enable multiple users. Proxy Address The IP address where the proxy is running. If you are hosting the debugger on your PC, use 127.0.0.1 Proxy Port The port that the proxy is listening on.
These options are discussed in detail in the section "PHP Debugging" on page 1224 of Chapter 29 of the WebSmart User Guide.
- Update your php.ini file. In your IFS, open the file usr/local/zendsvr/etc/php.ini. Add these lines:
Confirm the zend_extension path matches the location where you copied xdebug.so.
- In your php.ini configuration, set the xdebug.remote_host value. The single and multi-user setup instructions here are slightly different:
- Single User Setup. To configure the PHP debugger for a single user, replace the value IP_ADDRESS with the IP address of the PC on which you are running WebSmart.
- Multi User Setup. To configure the PHP debugger for multiple users, replace the value IP_ADDRESS with the IP address of the PC on which you are running the proxy server.
One way to find your IP address is by going to Start > Control Panel and selecting Network Connections. In the list of network connections, right-click the Local Area Connection icon and select the Status option. In the Support tab you can find your IP address. Note that these instructions may vary by PC operating system. You can also just ask your Network Admin!
- Still in php.ini, disable the Zend debugger. Zend's debugger only works with Zend Studio and can't be used with other IDEs. To disable Zend's debugger, find the line below in your php.ini file (if present) and insert a semi-colon at the start of it to comment it out:
Now you can save and close php.ini.
Note: In later release this line might be found in a file called
- If you haven't already, end and restart the WebSmart IDE.
- Restart your WebSmart HTTP server.
- Confirm your settings. To confirm your settings, you can execute the phpinfo(); function.
An easy way to display this information is by creating a new WebSmart PHP program using the "A Simple Page" template and inserting the line "phpinfo();". Then press F6 to save, generate, and run your program.
? At the phpinfo page, search for "xdebug.remote_enable"; this option should be set to On. Then search for "xdebug.remote_host"; this should show your computer's IP address.
You can use the
ENDTCPSVR SERVER(*HTTP) HTTPSVR(WEBSMART)on the IBM i to end the server, and start it with the command
STRTCPSVR SERVER(*HTTP) HTTPSVR(WEBSMART).
At this point, you are done with the installation and configuration of WebSmart and/or Clover. The next two steps contain useful trouble-shooting and educational information accordingly.