php调试利器 xdebug

php调试利器 xdebug

xdebug官方网站http://xdebug.org/

在Linux下编译安装XDebug

引用
tar -xzf xdebug-2.0.0RC3.gz
cd xdebug-2.0.0RC3
/usr/local/php/bin/phpize
./configure --enable-xdebug
cp modules/xdebug.so /usr/local/php/lib/php/extensions/no-debug-non-zts-20020429/

注:/usr/local/php/lib/php/extensions/no-debug-non-zts-20020429/不同的PHP版本路径不同,也不一定要放在该路径,可以在zend_extension_ts中自行指定xdebug.so所在位置。

Windows安装:
1. 登录www.xdebug.org,在下载您需要的版本,建议下载Windows binaries,免去手工编译,根据你的php版本选择其中的PHP5.2或5.3的,下载php_xdebug-xxxx.dll文件;建议下载稳定版,而不是beta版,当然beta版一般也不会出问题.
2. 将下载的php_xdebug-xxx.dll放到C:\php5\ext目录,重命名为php_xdebug.dll;路径根据您的php安装路经不同可能有所有同.
3. 编辑php.ini,加入下面几行:
extension=php_xdebug.dll
[Xdebug]
xdebug.profiler_enable=on
xdebug.trace_output_dir="J:\php_xdebug_output"
xdebug.profiler_output_dir="J:\php_xdebug_output"
后面的目录“J:\php_xdebug_output”为你想要放置Xdebug输出的数据文件的目录,可自由设置。
4. 重启Apache (或iis);
可以专门写几行有错的代码,看看出错信息显示不何不同。
再用var_dump()输出一个数组,看看显示是不是友好多了,至少不用查看html源文件才能看到清晰的数组结构.

linux下Mysql+php5+apache安装手记

下载官方推荐的稳定版本httpd-2.2.3.tar.gz,下载地址:http://down.itlearner.com/soft/2356.shtml

安装apache2
#./configure --prefix=/usr/local/apache2 --enable-module=alias --enable-module=most \
--enable-module=vhost_alias --enable-shared=vhost_alias --enable-module=so --enable-shared=max
# make;make install

--------------------------------------------------------------

下载目前最新稳定版本mysql-standard-5.0.27-linux-i686-glibc23.tar.gz
无需安装,解压后移至/usr/local/mysql.

# groupadd mysql #建立mysql组
# useradd mysql -g mysql #建立mysql用户并且加入到mysql组中

# cd /usr/local/mysql

然后设置权限

# chown -R root . #设定root能访问/usr/local/mysql
# chown -R mysql data #设定mysql用户能访问/usr/local/mysql/data ,里面存的是mysql的数据库文件
# chown -R mysql data/. #设定mysql用户能访问/usr/local/mysql/data下的所有文件
# chown -R mysql data/mysql/. #设定mysql用户能访问/usr/local/mysql/data/mysql下的所有文件
# chgrp -R mysql . #设定mysql组能够访问/usr/local/mysql

运行mysql:

# /usr/local/mysql/bin/mysqld_safe --user=mysql &

修改root密码,默认为空:

/usr/local/mysql/bin/mysqladmin -u root password 'newpassword'

MYSQL安装完成

----------------------------------------------------------------

下载最新稳定版本php-5.1.6.tar.gz,下载地址:http://down.itlearner.com/soft/2355.shtml

1. 安装zlib (安装libpng和gd前需要先安装zlib),下载地址:http://down.itlearner.com/soft/2359.shtml
# tar zxvf zlib-1.2.3.tar.gz
# cd zlib-1.2.3
# ./configure
# make;make install

2. 安装libpng,下载地址:http://down.itlearner.com/soft/2362.shtml
# tar zxvf libpng-1.2.12.tar.gz
# cd libpng-1.2.12
# ./configure
# make;make install

3. 安装freetype,下载地址:http://down.itlearner.com/soft/2361.shtml
# tar zxvf freetype-2.2.1.tar.gz
# cd freetype-2.1.10
# ./configure --prefix=/usr/local/freetype
# make;make install

4. 安装jpeg,下载地址:http://down.itlearner.com/soft/2360.shtml
# tar zxvf jpegsrc.v6b.tar.gz
# cd jpeg-6b
# mkdir /usr/local/jpeg
# mkdir /usr/local/jpeg/bin
# mkdir /usr/local/jpeg/lib
# mkdir /usr/local/jpeg/include
# mkdir /usr/local/jpeg/man
# mkdir /usr/local/jpeg/man/man1
# ./configure --prefix=/usr/local/jpeg --enable-shared --enable-static
# make;make install

5. 安装gd,下载地址:http://down.itlearner.com/soft/2357.shtml
# tar zxvf gd-2.0.33.tar.gz
# cd gd-2.0.33
# ./configure --prefix=/usr/local/gd --with-jpeg=/usr/local/jpeg --with-freetype=/usr/local/freetype --with-png --with-zlib
//编译过程中会看到如下信息
** Configuration summary for gd 2.0.33:

Support for PNG library: yes
Support for JPEG library: yes
Support for Freetype 2.x library: yes
Support for Fontconfig library: no
Support for Xpm library: no
Support for pthreads: yes
//可以看到png 、 jpeg 、 freetype都已经安装上了
# make
# make install

6. 正式安装php
# tar zxvf php-5.1.6.tar.gz
# cd php-5.1.6
# ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-gd --with-zlib --with-png --with-jpeg --with-freetype --enable-sockets --with-iconv --enable-mbstring --enable-track-vars --enable-force-cgi-redirect --with-config-file-path=/usr/local/php5/etc

7.整合php和apache
cp php.ini-dist /usr/local/php5/etc/php.ini
vi /usr/local/php5/etc/php.ini
将extension=php_mysql.dll前面的#去掉

8. 安装ZendOptimizer,下载地址:http://down.itlearner.com/soft/1023.shtml
# tar zxvf ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz
# cd ZendOptimizer-3.0.1-linux-glibc21-i386
# ./install.sh
安装操作: [ok] -> [EXIT] -> [YES] -> [/httpd/zend] -> [/httpd/apache/conf] -> [yes] -> [OK] -> [OK] -> [NO]

遇到的一些错误解决:

1.php5在configure时提示:configure: error: mysql configure failed.,只用--with-mysql参数提示:Cannot find MySQL header files under yes,去掉--with-mysql参数可以安装,php5将无法连接mysql,页面提示为:Fatal error: Call to undefined function mysql_connect()。查阅了一下,发现是mysql5对应的版本不对导致的,换个版本就可以了。
我用mysql-standard-5.0.27-linux-i686.tar.gz时会提示,换了mysql-standard-5.0.27-linux-i686-glibc23.tar.gz后就正常了。

2.重装mysql后启动出错,提示:
Starting mysqld daemon with databases from /usr/local/mysql/data
STOPPING server from pid file /usr/local/mysql/data/xmcncn.pid
061103 15:25:32 mysqld ended
请教高手gump,解决方法:
touch /tmp/mysql.sock
killall -9 mysqld
/usr/local/mysql/bin/mysqld_safe -user=mysql &
成功启动

PS:偶是新手,当初找齐这些软件都化了一整天时间,特别是几个小软件比较难找,现在全部列出来了。测试装的时候也遇到了不少问题,在gump同志的帮助下解决了不少。我站上本来转载了好几篇安装的文章,有的版本较旧,有的不太全面,所以把这次安装过程写出来,以后安装也就方便了:)希望也对一些新手有帮助。

几个有用的查询网站 互联网相关

  网站历史查询http://www.archive.org/index.php

  Web网页信息http://www.infomall.cn/

  日文注册查询http://whois.co.jp

  国外域名交易网站http://www.sedo.com/

  ip绑定域名查询http://whois.webhosting.info/

  银点停放http://www.silverclicks.com.cn/

  易域网域名论坛 http://www.domain.cn/club

  网络实名查询http://realname.alibaba.com.cn/

  通用网址查询http://seal.cnnic.cn/index.html

  百度竞价排名http://jingjia.baidu.com

  雅虎竞价排名http://p4p.cn.yahoo.com/

  国外关键词竞标http://overture.showdn.com/

  百度指数http://index.baidu.com/

  百度相关关键词排行http://d.baidu.com/rs.php

  百度热门搜索http://top.baidu.com/top_keyword.html

  百度火爆地带http://ma.baidu.com/fs/inquire/price.php

  Google PageRank 查询http://tool.chinaz.com/Rank/

  百度词典http://dict.baidu.com/

  汉字转拼音http://tool.chinaz.com/Trans/Word_Spell.asp

  中国网络备案中心http://www.miibeian.gov.cn/

  全球网站排行TOP500http://www.alexa.com

  中国互联网络信息中心http://www.cnnic.cn

  网页关键词密度分析工具http://www.keyworddensity.com/

  时代互联批量查询http://www.now.cn/domain/mcheck.net

  其他语言国际域名的转码http://mct.verisign-grs.com/index.shtml

  亚洲域名域名争议解决中心http://www.adndrc.org/adndrc/bjc_home.html

  阿里巴巴热门词http://info.china.alibaba.com/news/subject/v1-s5011580.html

  Google中国热门关键词http://www.google.com/intl/en/press/intl-zeitgeist.html#cn

  Yahoo搜索排行榜http://top.cn.yahoo.com/index.html?source=yahoo_buzz_allsrvc

  Google AdWords 关键字https://adwords.google.com/select/KeywordToolExternal

  在线翻译http://www.worldlingo.com/zh/microsoft/computer_translation.html

  国外域名停放http://www.sedo.com

  域名排名查询http://www.alexa.com

from: http://www.cndns.com/help/?t=1&c=20&s=10&classid=35&id=221

为firefox开启DNS解析缓存功能

某些linux发行版默认没有打开操作系统级的DNS解析的缓存功能,从而造成(使用firefox)第打开一个网页,等待时间很长,而这个等待时间大多是在等待DNS解析,非常影响上网效率。可以打开firefox内置的dns解析缓存功能改善这一状况,方法如下:
Firefox有dns缓存功能,但是默认缓存时间只有1分钟,可以通过修改该默认值加快DNS解析速度,方法如下:
打开一个新的窗口,地址栏输 入 about:config,回车,进入设置界面。然后搜索 network.dnsCacheExpiration ,把原来的60改成 6000(表示缓存6000秒),再搜索network.dnsCacheEntries 把默认的20改成1000(表示缓存1000条)。如果没 有上面两个项目,新建它们即可,新建条目类型为整数型。 当然也可以按照需要设置成其它的值。
但是dns缓存太久了也会出问题,比如有的网站ip换了,就无法访问了。
针对这样的问题,还可以安装一个 firefox 插件来开启或者 关闭dns cache功能,https://addons.mozilla.org/zh-CN/firefox/addon/5914 。