配置搭建EasyPHP5.3.6.1+Eclipse4.2.0+xDebug的PHP开发环境
来源:互联网 发布:刘琨 祖逖 知乎 编辑:程序博客网 时间:2024/05/29 06:44
Suppose we've already had EasyPHP5.3.6.1 installed. It comes with PHP 5.3.6.
(By the way, you can access phpMyadmin from: localhost/home/mysql/)
Step 1: Install Eclipse for PHP Dev:
(1). Download JDK and install it, and then add '../bin/' to PATH environment variable.
(2). Download Eclipse4.2, and then follow the instructions on this page to install PHP development package:PDT/Installation
Step 2: Install and Setup xDebug
Download the latest version from http://www.xdebug.org/download.php.
EasyPHP has already included xDebug2.1.1, you can view that by visiting: http://127.0.0.1/home/index.php?to=phpinfo
My following steps were referenced to these blogs:
http://www.bwcsc.net/?q=node/644
http://be-evil.org/post-70.html
http://aofengblog.blog.163.com/blog/static/631702120117283414706/
They all started at installing xDebug manually, but we already have it, so I also skip their steps of configuration for xDebug. I just started at setting Eclipse.
Go to [Window=>Preferences], select 'PHP' to expand its nodes, and select 'PHP Executables', see:
Not like the shot, there used to be nothing in my case, so I click 'Add':
Fill in the blanks, the Name is arbitrary. Others depends on your situation.
Then go back to PHP->Debug panel, see:
Click 'PHP Server' to config:
When I went here first time, it was not like this(as the snapshot, it was taken afterward), its name is something else, and the URL is 'http://localhost/', so click 'Edit', go:
Somebody said that the Site Map need to be set as well, but in my case, I just left it. Because I am using EasyPHP, I should use 127.0.0.1 instead of localhost, or you can map that by editing C:/windows/system32/driver/ect/host.
Finally, it would be something like:
Step 3: Try It
Now reopen Eclipse, open one PHP script, add break-point:
Debug the site:
There would prompt a dialog to ask for your confirmation for letting the debug plugin change the perspectives for the first time run, and you can just click OK.
Some shortcuts:
1. Ctrl-Shift-B: set breakpoint;
2. F5: step in;
3. F6: step out;
4. F8: run;
Conclution: How to Debug PHP Web App
Although you see it is such a big deal with configuring Eclipse and xDebug (or some other debug tools should be similar, I guess), it can't do much for you. I did a kind of experiment, trying to change something and see if it would make some differences~~~ not much indeed.
For example, the panel of PHP server:
It doesn't matter whether you fill into it with 'C:\EasyPHP-5.3.6.1\www' or 'C:\EasyPHP-5.3.6.1\www\somesubpath'. And it doesn't matter either whether you set a mapping path or not. You provide more information here just doesn't make it a little bit cleverer at all.
So, what does really matter? When you select a PHP script file, say../subpath/anothersubpath/some.php, and go to [debug->debug as PHP application], which will bring up a confirm box, being filled with a default URL, asking you if you wanna use that value or change it as you want, like:
and this default URL is just matching its local directory in file system(http://yourdomainname/subpath/anothersubpath/some.php), so you may change it in mainly two cases:
1. you are using a MVC framework, like I am now, the file can't be request directly, it always be called via routing from the entry point(index.php usually);
2. you are mapping your certain path to a domain name, as virtual host always is.
So, you just figure it out on your own, and keep in mind that, your debug URL(should be filled into the above box), just depends on your Web server configuration(Apache.i.e), nothing else. How can you access it through browser, then how you fill in it.
After that, you launch a debug session, and the perspective would change, just as you see in the above screen shots, including a browser which is shipped with Eclipse, it's built in, I guess. And you may notice that the URL are appended with some parameters, like DEBUG_SESSION_KEY, fortunately, you can copy this URL and paste it into your other browsers, such as Chrome and Firefox----to continue your debug, that is just fine.
This approach of debug can be adequate for most of occasions.
- 配置搭建EasyPHP5.3.6.1+Eclipse4.2.0+xDebug的PHP开发环境
- PHP开发环境搭建 (XAMPP+Xdebug+netbeans,配置调试),创建第一个php项目
- 【转】 Eclipse+php插件+Xdebug搭建PHP开发/调试环境
- php+xdebug+eclipse环境搭建
- NetBeans7.0 搭配XDebug搭建PHP整合开发调试环境
- PHP开发环境搭建(Eclipse PDT XAMPP XDEBUG)
- PHP 开发环境搭建( Eclipse PDT XAMPP XDEBUG)
- PHP 开发环境搭建( Eclipse PDT XAMPP XDEBUG)
- Eclipse for php + Xdebug搭建PHP的调试环境
- Eclipse for php + Xdebug搭建PHP的调试环境
- Android开发环境搭建(Eclipse4.2)
- Android开发环境搭建(Eclipse4.2)
- Android开发环境搭建(Eclipse4.2)
- Android开发环境搭建(Eclipse4.2)
- win7 下配置php开发环境以及phpunit、xdebug
- 超详细 PHP 开发环境配置:WampServer+ZendStudio+XDebug
- Ubuntu16.04下配置php+vscode+xdebug开发环境
- 超详细 PHP 开发环境配置:WampServer+ZendStudio+XDebug
- 什么是OpenStack?
- 再看老帖《月薪过万请不动程序员 中国软件人才薪水过高?》
- Android设备功能之录音教程篇
- C#解析manifest,不完全
- Weblogic常用监控指标
- 配置搭建EasyPHP5.3.6.1+Eclipse4.2.0+xDebug的PHP开发环境
- 浅谈高内聚与松耦合,各人自扫门前雪,莫管他人瓦上霜
- cocos2d-iphone之魔塔20层第十一部分
- 孙鑫19课笔记
- 笔记本电脑参数简析(学生选择)
- OpenStack Nova存储管理聪明做法
- 求最短路径算法之Floyd算法
- 【原创】商论之:幼儿园的思维和学前班的做法!
- (APUE点滴记录) 进程控制之fork与vfork