PHP调试的一般步骤学习记录
本文只是在尝试PHP调试后获得的若干经验的记录。
PHP的IDE调试都比较痛苦,一般很难有集成的IDE。在习惯用MyEclipse调试JSP应用后,再去开发PHP程序总觉得特别麻烦,其最大原因可能就是调试环境的安装和配置。笔者尝试过N次,什么xDebug,DBG Script,Zend Debugger,统统整了一遍,经常崩溃的,也放弃过好几次,真tmd的xxx。以下记录在Zend Studio for Eclipse 配置 Zend Debugger的步骤,供日后参考,也供过客阅览。
1,下载 Zeng Debugger
目前(20100303)有效地址是:
http://downloads.zend.com/pdt/server-debugger/ZendDebugger-5.2.14-cygwin_nt-i386.zip
下载得到的包中有个README.txt,说的比较清楚:
Zend Debugger installation instructions
---------------------------------------
1. Locate ZendDebugger.so or ZendDebugger.dll file that is compiled for the
correct version of PHP (4.3.x, 4.4.x, 5.0.x, 5.1.x, 5.2.x) in the
appropriate directory.
2. Add the following line to the php.ini file:
Linux and Mac OS X: zend_extension=/full/path/to/ZendDebugger.so
Windows: zend_extension_ts=/full/path/to/ZendDebugger.dll
Windows non-tread safe: zend_extension=/full/path/to/ZendDebugger.dll
(*) the windows non-thread safe is used only with Zend Core 2.0
3. Add the following lines to the php.ini file:
zend_debugger.allow_hosts=<ip_addresses>
zend_debugger.expose_remotely=always
4. Place dummy.php file in the document root directory.
5. Restart web server.
2,按照上面的说明,把相关版本的dll放入PHP的安装目录的ext下
ZendDebugger.dll要选择与php版本相匹配的
3,把debugger带的dummy.php复制到apache网站根目录,dummy.php主要用来与浏览器安装的Zend Studio Toolbar通信
4,配置php.ini
[Zend]
zend_extension_ts=D:/PHP/ext/ZendDebugger.dll
zend_debugger.allow_hosts=127.0.0.1/32 【本机IP地址/32】
zend_debugger.a
相关文档:
//冒泡排序(数组中实现)
function bubble_sort($arr) {
$cnt = count($arr);
if($cnt<=0) return false;
for($i=0; $i<$cnt;$i++) {
for($j=$cnt-1; $j>$i;$j--) {
if($arr[$j]<$arr[$j-1]) {
$tmp = $arr[$j];
$arr[$j] = $arr[$j ......
每个人都知道php.net,我们或早或晚的都会来到这里并不断的访问它。它是PHPer的主要参考网站,拥有大量有用的信息,但是这些信息却不是那么显而易见。
比较有用的官方PHP资源:
PHP官方函数手册下载: http://www.php.net/download-docs.php
包含最新的chm中文版本,HTML版本
中文函数手册:http://www.php.net/m ......
在PHP中有urlencode()、urldecode()、rawurlencode()、rawurldecode()这些函数来解决网页
URL编码解码问题。
在ASP的时候URL编码解码很是恼火,Server.urlencode不太好用,遇到utf-8编码的地址更是麻
烦。你要获取百度、Google点击到网站的网址链接中的关键字,要写上一堆自定义函数来得到urldecode的效果。
摘录一篇关 ......
安装完php 和 apache后,如果apache 不支持 php
1.apache中没有 php加载模块。
在httpd.conf中加入。
LoadModule php5_module "c:/php5/php5apache2_2.dll"
AddType application/x-httpd-php .php
如果 不能正常启动apache 可能是apache版 本的事。可以修改 LoadModule php5_module "c:/php5/php5apache2_2.dll"
&n ......
第一章 PHP概述
1、 基本语法
a) 要把php嵌入页面,可以把它放在PHP标签内
<?php ?>
b) 在body标签结束之前,插入php代码
c)   ......