Home > php教程 > php手册 > body text

wordpress 调试环境建立【Xampp + Zend studio + xdebug(php5.4

WBOY
Release: 2016-06-06 19:40:47
Original
1308 people have browsed it

1. Xampp 安装 官网:http://www.apachefriends.org/en/xampp-windows.html#641,选择合适的版本下载后一路安装 2. Zend studio 安装 a. 下载 Zend studio 官网地址: http://www.zend.com/en/products/studio/downloads?platform=Windows b. 破解Zend studi

1. Xampp 安装

    官网:http://www.apachefriends.org/en/xampp-windows.html#641,选择合适的版本下载后一路安装

2. Zend studio 安装

    a. 下载 Zend studio

        官网地址: http://www.zend.com/en/products/studio/downloads?platform=Windows

    b. 破解Zend studio

        参考:http://www.geekso.com/ZendStudio100/3/1/

3. 下载wordpress源码

   a. 下载

     官网地址:http://wordpress.org/download/

   b. 下载后解压到xampp安装目录下的htdocs目录下

    c. 启动xampp control panel下的apache和mysql(有端口冲突的话看旁边的Netstat,关闭或修改相冲突的服务,典型的skype和vititualSVN)

         wordpress 调试环境建立【Xampp + Zend studio + xdebug(php5.4

     d. 浏览器中输入:localhost/phpmyadmin

         配置Wordpress的config文件htdocs\wordpress\wp-config.php   (需要把wp-config-sample.php改为wp-config.php)

define('DB_NAME', 'XAMPP-Blog');

/** MySQL数据库用户名 */
define('DB_USER', 'root');

/** MySQL数据库密码 */
define('DB_PASSWORD', '');

/** MySQL主机 */
define('DB_HOST', 'localhost');

/** 创建数据表时默认的文字编码 */
define('DB_CHARSET', 'utf8');

/** 数据库整理类型。如不确定请勿更改 */
define('DB_COLLATE', '');

其实就是改了三个地方:
DB_NAME(数据库名称,也就是我刚才设置的”pademo”),
DB_USER(数据库的用户名,因为这是本地安装,用户名设为”root”即可)
DB_PASSWORD(数据库密码,空白,注意是两个单引号中间空白,不是完全不要,也不是双引号)
$table_prefix = ‘wp_’; 看一下这一语句,这是给数据库的表前缀,假如你想安装两个Wordpress在本地,那你的另一个博客就不能使用wp前缀的表,就应该修改成其它前缀,比如pptv反正不一样就可以了。这也同样适用于远程网络,给你的一个数据库设置多个博客。


4. 配置xdebug

 a.  改php.ini

[XDebug]
zend_extension = "F:\xampp\src\php\ext\php_xdebug-2.2.1-5.4-vc9.dll"
;xdebug.profiler_append = 0
xdebug.profiler_enable = 1
;xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "F:\xampp\src\tmp"
;xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9000
;xdebug.trace_output_dir = "F:\xampp\src\tmp"


其中:php_xdebug-2.2.1-5.4-vc9.dll下载自:http://www.xdebug.org/download.php(要翻墙)下的与php版本对应的dll

我的php版本是5.4

可查看:http://localhost/xampp/index.php,下面的phpinfo:


wordpress 调试环境建立【Xampp + Zend studio + xdebug(php5.4wordpress 调试环境建立【Xampp + Zend studio + xdebug(php5.4

注意:php5.4 是thread safe 的,所以下的库不要是nf的。


  b.  重启XAMPP Control Panel 的Apache,再刷新http://localhost/xampp/index.php

        可见:

wordpress 调试环境建立【Xampp + Zend studio + xdebug(php5.4


     表示zend studio 下的xdebug配置成功。


   c. 打开zend studio  Windows->Preferences->PHP->Debug设置如下

wordpress 调试环境建立【Xampp + Zend studio + xdebug(php5.4

 

   d.  断点调试

       Debug As->PHP Web Application,进入Debug透视图

wordpress 调试环境建立【Xampp + Zend studio + xdebug(php5.4

   有箭头表示可以跟踪了。。。

 

5.后记

    C/C++出身的初次弄这些东西确实悲惨,万事只能Google,希望可以坚持下去,不像之前学习Android 和 openmeeting那样半途而废。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!