“技术”目录存档

xdebug调试php,断点不起作用

2010年09月2日,星期四

在xp上装了eclipse和VMware, 在VMware上装了redhat, 在redhat上装了apache,php,xdebug,在php.ini里配置xdebug如下:

zend_extension=/usr/lib/php/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so
xdebug.remote_enable=On
xdebug.remote_autostart=On
xdebug.remote_handler=dbgp
xdebug.remote_host=xx.xx.xx.xx
xdebug.remote_port=9000
xdebug.remote_mode=req

然后在eclipse里设置断点,发现断点不起作用,直接所有的代码一次性运行完了,到xdebug官网仔细看了下配置的说明, 原来xdebug.remote_host并不是apache所在服务器的IP, 而是远程调试机的IP, 我的情况,也就是xp的ip, 而不是VMware上redhat的IP,可原来我却把xx.xx.xx.xx配成了redhat的IP, 修改xx.xx.xx.xx为xp的IP,重启apache, 一试,果然单步调试成功了。

zend studio打不开页面

2010年08月29日,星期天

今天想试一下zend studio, 在官方网下载好在win7下安装后,发现zend server其实就是apache, zend studio就是扩展了eclipse,但zend server/studio却还要收钱,真不知道是怎么遵守开源协议的。

创建一个test项目后,结果页面都打不开,返回的错误是这样的:Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, admin@example.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

花了不少时间看它们配置,发现配置都没什么问题,有点恼火啊,功夫不负有心人,原来这个文件Zend\ZendServer\etc\ZendEnablerConf.xml 第一行出现了乱码:锘??xml version=”1.0″ encoding=”UTF-8″?>
把它改为:<?xml 就行了

shell电话本

2010年08月23日,星期一

前几天在MSDN上看到有人用shell写了个电话本程序,为了巩固一下以前学过的, 自己也来弄一个shell电话本[绝非抄袭]。其实不能算一个电话本,因为只有两个域:名字和地址,权当练习,不尽完美之处,请海涵:D

#!/bin/sh
#Date: 2010-08-22
#QQ: 32281309
#MSN: pgj1207@hotmail.com
#Site: www.genepeng.cn

function AddUser()
{
while :
do
echo -n “Enter user name: ”
read UserName
if [ "$UserName" = "" ]; then
continue
else
break
fi
done

while :
do
echo -n “Enter Address: ”
read Address
if [ "$Address" = "" ]; then
continue
else
break
fi
done

echo -e “$UserName\t$Address” >> $FileName
}
(全文…)

win7 VMware 7.0下centos不能上网

2010年08月21日,星期六

之前的CentOS是xp和VMware下安装的,上网等功能一切正常,但后来装了win7后上网功能出现了问题
情况如下:
-> win7 ping不通虚拟机下CentOS
-> CentOS 能ping win7和外网,但是不能浏览网页
-> 在win7下,用putty也访问不了CentOS
-> win7, CentOS的防火墙都关了

后来发现原来是安装的瑞星防火墙的原因, 改变相应的设置,或直接把瑞星防火墙关掉就可以了

install_driver(Oracle) failed: Can’t load `…/DBD/Oracle/Oracle.so’ for module DBD::Oracle

2010年04月15日,星期四

Description

This section is from the "Practical mod_perl " book, by Stas Bekman and Eric Cholet . Also available from Amazon: Practical mod_perl

Here’s an example of the full error report that you might see:

install_driver(Oracle) failed: Can't load

'/usr/lib/perl5/site_perl/5.6.1/i386-linux/auto/DBD/Oracle/Oracle.so'

for module DBD::Oracle:

libclntsh.so.8.0: cannot open shared object file: 

No such file or directory at

/usr/lib/perl5/5.6.1/i386-linux/DynaLoader.pm line 169.

at (eval 27) line 3

Perhaps a required shared

library or dll isn't installed where expected at 

/usr/local/apache/perl/tmp.pl line 11


 

On BSD-style filesystems, LD_LIBRARY_PATH is not searched for setuid programs. If Apache is a setuid executable, you might receive this error. Therefore, the first solution is to explicitly load the library from the system-wide ldconfig configuration file:

panic# echo $ORACLE_HOME/lib >> /etc/ld.so.conf

panic# ldconfig

(使用该方法我的问题就解决了)

Another solution to this problem is to modify the Makefile file (which is created when you run perl Makefile.PL ) as follows:

  1. Search for the line LD_RUN_PATH=

  2. Replace it with LD_RUN_PATH=my_oracle_home/lib

where my_oracle_home is, of course, the home path to your Oracle installation. In particular, the file libclntsh.so.8.0 should exist in the lib subdirectory.

Then just type make install , and all should go well.

Note that setting LD_RUN_PATH has the effect of hardcoding the path to my_oracle_home/lib in the file Oracle.so , which is generated by DBD::Oracle . This is an efficiency mechanism, so that at runtime it doesn’t have to search through LD_LIBRARY_PATH or the default directories used by ld.

For more information, see the ld manpage and the essay on LD_LIBRARY_PATH at http://www.visi.com/~barr/ldpath.html .