php-5.3.3 mssql support

发布于: 2013年10月15日

系统环境:

CentOS 6.4

软件仓库php5.3.3 带php-devel包

希望能够得到mssql.so 支持。

安装freetds:

http://www.freetds.org/ 下载最新稳定版本:freetds.stable.tgz 我得到的版本是0.91。下方的命令安装:

# tar zxvf freetds-current.tgz

# ./configure –prefix=/usr/local/freetds –with-tdsver=7.2 –enable-msdblib

# make

# make install

配置,我要求链接到SQL Server 2005:

修改/usr/local/freetds/etc/freetds.conf

[Server2005]
host = 192.168.1.100 #根据自己改

port = 1433

tds version = 7.2

client charset = UTF-8

tds version 选择参考:http://www.freetds.org/userguide/choosingtdsprotocol.htm

Server2005这个名字会在PHP 链接代码中用到。

mssql.so文件编译:

由于是软件仓库安装,并没有源代码。也没有php-mssql这样的软件包。所以编译mssql.so比较特殊,但也是可以。

下载php-5.3.3源码,老版本源码在这里下载:http://www.php.net/releases/

解压,进入目录:php-5.3.3/ext/mssql

#phpize

#./configure –with-php-config=/usr/bin/php-config –with-mssql=/usr/local/freetds

#make

#make install

make 的时候可能出现下面的错误:

/usr/include/php/main/spprintf.h:40: note: expected ‘char **’ but argument is of type ‘unsigned char **’

make: *** [php_mssql.lo] Error 1

修改 php-5.3.3/ext/mssql/php_mssql.h 24行增加一行:

#define PHP_MSSQL_API
此为bug,已经有人报告,见链接:https://bugs.php.net/bug.php?id=60267

编译成功后,会在/usr/lib/php/modules中出现mssql.so文件,64位的位于/usr/lib64/php/modules 中。在php.ini增加
extension=mssql.so

重启apache.
php链接mssql 代码:
mssql_pconnect('Server2005',username,passwd);

Good luck!

 

USB安装CentOS6.4 64位的主要问题解决

发布于: 2013年10月15日

目的:安装CentOS 6.4 64位到裸机,硬盘未格式化

安装要求:电脑无DVD Driver, 从USB安装CentOS6.4 64位系统

安装步骤:

1. 下载DVD iso介质:http://mirrors.163.com/centos/6.4/isos/x86_64/

文件列表:

CentOS-6.4-x86_64-bin-DVD1.iso (4.25G)

CentOS-6.4-x86_64-bin-DVD2.iso (1.41G )

CentOS-6.4-x86_64-minimal.iso(342M)(用处后提)

2. 制作USB启动,

取8G USB flash,  将CentOS-6.4-x86_64-bin-DVD1.iso文件烧录到USB drive.

在windows下可以使用ultraiso,试用版即可。 Win7 系统需要以管理员权限运行。

3. Copy 下列安装介质到USB flash,

CentOS-6.4-x86_64-bin-DVD1.iso (4.25G)

CentOS-6.4-x86_64-bin-DVD2.iso (1.41G )

问题:8G U盘不能同时装下两个4.25G的文件(一个烧录+一个完整iso文件),且fat32格式的文件系统不能放置大于4G的单个文件。

解决方案一:另取一个USB flash, 格式化为exfat格式即可copy。但由于CentOS 6.4 安装过程中的bash环境不直接支持exfat 格式的mount,故比较麻烦。

解决方案二:另取一个USB flash, 在linux 下格式化为ext2格式 copy。可行但不完美。

采用上面方法,需要在安装到无法找到安装介质步骤是,ctrl+alt+F2切换到第二终端,将iso文件所在目录mout到/mnt/isodir 目录下。

解决方案三:使用CentOS-6.4-x86_64-minimal.iso(342M)文件进行最小化安装。直接将此文件copy到烧录的USB flash根目录。进行最小化安装。然后根据需要从网络或copy 安装介质dvd到目录CentOS系统下扩展安装。具体升级扩展安装方法我参考下链接:

http://hi.baidu.com/waybol/item/a957ae3f8fad48a3633affa4

不过最小化安装启动时是不自动启动网卡的,请执行:

#ifup eth0

如果没有自动获取IP, 则执行:

#dhclient eth0

安装X Window

#yum groupinstall “X Window System”

安装GNOME桌面环境

#yum groupinstall “Desktop”

安装其他你想安装的软件包。

完毕!

rsyncd.conf 目录名含空格问题

发布于: 2013年09月26日

Server 端: Windows XP

Server 端版本:cwRsync 4.0.5

测试Client: CentOS 6.4 rsync 3.0.6

问题:

当Server端共享目录存在空格时,同步时可能出现下列错误:

@ERROR: chdir failed

rsync error: error starting client-server protocol ( code 5) at main.c(1503)

我尝试的以下绝对不可行方案如下,请勿重复尝试。

假设共享目录:c:\Program Files\test

rsyncd.conf 代码错误示范1:

[TEST]
path = “/cygdrive/c/Program Files/test”
read only = true
transfer logging = yes

rsyncd.conf 代码错误示范2:

[TEST]
path = “/cygdrive/c/Program\ Files/test”
read only = true
transfer logging = yes

rsyncd.conf 代码错误示范3:

[TEST]
path = ‘/cygdrive/c/Program Files/test’
read only = true
transfer logging = yes

rsyncd.conf 代码错误示范4:

[TEST]
path = /cygdrive/c/Program\ Files/test
read only = true
transfer logging = yes

可能可行的方案:

rsyncd.conf 可能可行的方案:

[TEST]
path = /cygdrive/c/”Program Files”/test
read only = true
transfer logging = yes

上面的方案我个人测试未通过,但网上有人测试通过。 相关网址:http://stackoverflow.com/questions/6993355/cwrsync-failing-due-to-spaces-in-directory-names

rsyncd.conf 我测试有条件通过,但你可能不行的方案:

[TEST]
path = /cygdrive/c/Program Files/test
read only = true
transfer logging = yes

是的,不要怀疑你自己的眼睛,什么都不加。我这边可以同步,但不会完成同步,不知道是否是有其他原因。

Google了一圈,这个问题似乎没有办法很好的解决。期待rsync的开发者改进了。

 

 

E17 is not ready

发布于: 2013年06月20日

去年在LT上看到了E17正式版的新闻。今年早些时候在Ubuntu上试用了一下,感觉良好,就是不太稳定。长期对Ubuntu稳定的怀疑,让我试图在Debian上进行E17的尝试。结果让我失望:

1. debe17.com 大多数内容最后一次更新在2011年

2. http://www.debianx.org/e17.html 页面上的内容也比较陈旧,easy_e17.sh项目已经被easy_efl.sh取代。

3. easy_efl.sh也是跟不上时代,因为e17的svn目录结构都经常在变。

4.svn结构变化之频繁,以至于自己网站上官方文档的指导文件都无法运行。下面的命令大多无法正常获得。

 $ svn co http://svn.enlightenment.org/svn/e/trunk/eina eina-svn
 $ svn co http://svn.enlightenment.org/svn/e/trunk/eet eet-svn
 $ svn co http://svn.enlightenment.org/svn/e/trunk/evas evas-svn
 $ svn co http://svn.enlightenment.org/svn/e/trunk/evas_generic_loaders evas_generic_loaders-svn
 $ svn co http://svn.enlightenment.org/svn/e/trunk/ecore ecore-svn
 $ svn co http://svn.enlightenment.org/svn/e/trunk/efreet efreet-svn
 $ svn co http://svn.enlightenment.org/svn/e/trunk/embryo embryo-svn
 $ svn co http://svn.enlightenment.org/svn/e/trunk/edje edje-svn
 $ svn co http://svn.enlightenment.org/svn/e/trunk/e_dbus e_dbus-svn
 $ svn co http://svn.enlightenment.org/svn/e/trunk/eio eio-svn

5. 直到我在http://www.debianuserforums.org一个页面上看到了这段话:

INSTALL NOTES:
—————————————————————————–
The most incredible and really unbelievable dream has become true:
You compiled e17 successfully!

经历了若干天的探索,都无法开始的我,只能对这段话Totally agree!

No! E17 is not ready!

LFS 105days

发布于: 2013年06月17日

今年1月底完成了一份Linux From Scratch, 可用,也堪用。

用fcrontab跑一些定期执行的东西,从局域网抓取一些东西。跑得还挺欢,系统也挺稳定的。

5月31日,办公室预计停电1小时。关掉了所有大的进程,希望notebook的老旧电池能够坚持一小时。结果预计的停电时间延长了,同时老旧电池也没有坚持到1小时。幸好我提前拍下了下面这个画面,LFS uptime: 105days 14 hrs 10 mins。

喜欢折腾的Linuxer注定是三心二意的,是什么原因促使我没有再次启动它?是E17!

我的主本本安装了Ubuntu,ppa源安装的E17系统很是惊艳,但却不太稳定。是Ubuntu?还是PPA?不得而知。在LFS上编译一个X环境失败,让我有点失望。于是让他在连续运行105天之后离开我也算是功成名就。

Goodbye, my LFS  after 105 days!

LFS 105days

[原创]关于中天这个人

发布于: 2013年06月17日

记得绰号林蛋大楚中天吗?江湖中听到此人名字,大多莞尔一笑。

但经过哥对此人多年的研究发现,楚中天绝非是一个简单的人物!

“如日中天”听过没?比如小明如日中天:表示小明正处于非常风光,得意的时期。

其中为何提到楚中天?个中含义各位自己体会。

林蛋大

浙ICP备18056264号-1