一. 安装linux ZendDebugger
到http://www.zend.com/en/products/studio/downloads
下载Studio Web Debugger
然压后选择合适版本的ZendDebugger.so
复制到/usr/lib/php/modules/目录
复制dummy.php到站点根目录
vi /etc/php.ini
加入以下内容
[Zend Debugger]
zend_extension="/usr/lib/php/modules/ZendDebugger.so"
zend_debugger.allow_hosts=127.0.0.1/32,10.0.0.0/8,192.168.0.0/16,172.16.0.0/12
zend_debugger.expose_remotely=1
zend_debugger.passive_mode_timeout=180
重启服务器就行了
各配置选项的含义参见:http://files.zend.com/help/Zend-Server-5-Community-Edition/zenddebugger.html
sh# php -v (有可能是与zend_optimizer冲突)
Zend Studio配置:
工具->首选项->调试 调试方式选服务器,debugger server url为网站的浏览地址,dummy.php就是放在这个目录下
重启IDE,进行调试
zend studio 7.0以上的版本操作:
1 ) . 先为studio添加新的服务器源,则你的linux web server地址
如:你的linux nginx/apache配置的域名为test.zend.com 即设置Default PHP Web Server或者新添的server2的URL为
http://test.zend.com
另: 你的dummy.php也即放在此目录下,则:http://test.zend.com/dummy.php
英文help:
To add a new server to the list or edit an existing server configuration:
-
Click New
-Or- select an existing server and click Edit.
-
Enter the name of your server.
-
Enter the URL that points to its document root.
-
Click Next.
The Server Path Mapping dialog appears.
-
If you would like to map a path on your server to a local path, click Add and enter:
-
The path on your server.
-
The path you would like to map it to in your Workspace or on your File System.
See Adding a Server Location Path Map for more information.
-
If you would like to enable integration with Zend Server, mark the 'Enable Zend Server Integration' checkbox and enter the relevant information:
-
URL Suffix - The suffix which should be added to the URL of your document root in order to browse to your Zend Server GUI.
-
Port number - Enter the port number you defined during Zend Server installation.
See the Zend Server FAQ site for default port number settings. -
Password - The password used to access your Zend Server GUI.
-
If you would like to enable integration with Zend Platform, mark the 'Enable Platform Integration' checkbox and enter the relevant information:
-
Platform GUI
-
Authentication - Your Platform User Name and Password
-
For more, see Defining a Platform Server.
-
Click Finish.
2) . 安装zend debugger
The Installed Debuggers Preferences page is accessed from Window | Preferences | PHP | Debug | Installed Debuggers.
DEBUG->installed Debugger-> Zend Debugger settings->Client Host/IP
其他的配置选项默认。
3). 测试
To debug a PHP Web Page
run -> debug config -> 新建一个测试 -> "Test Debugger"
查看是否正确,根据提示找原因修正错误!!
注意点、重点:
在安装完linux下的Zend Debugger,配置完后进入测试。发现怎么测怎么有错,也不能正常进行调试。后来找了一天的帮助文档,经过努力终于解决了问题:
1. 先查找你的linux web server 中的php扩展是否有
xcache.so,通过phpinfo()查看。
我这里会有Additional .ini : /etc/php5/cgi/conf.d/xcache.ini
2. 如果不需要请去掉扩展xcache的配置文件xcache.ini, 重启php
3. 再度Test Debugge -》 OK
虽然会出现另一个出错提示,但是不会影响调试功能。
见: http://echodittolabs.org/blog/2010/08/how-configure-eclipse-pdt-zend-server-debugger-mamp-drupal
注:
zend studio中的help
To set up communication between Zend Studio and the server on which you are debugging:
|