pmap命令

Linux下使用pmap命令能查看一个具体进程所用内存的分布情况。

pmap -x 进程号

我们可以通过这个命令查看apache的http进程的各个模块的内存调用,从而我们可以通过分析精简apache的模板。

GD编译出错解决

编译最新的2.0.35版本,用默认的 ./configure编译
当make的时候,出现以下错误

configure.ac:64: error: possibly undefined macro: AM_ICONV
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
make: *** [configure] Error 1


解决办法 ,编译加m4_pattern_allow参数

即:./configure --enable-m4_pattern_allow

便能顺利编译安装

Blog又要搬家了

服务器前前后后换了好几拨,每次搬家都得重新配置CGI,就是不喜欢CGI的繁琐,但又喜欢MT的纯静态页面,嗨,无法割舍。

发个贴测试一下,看看新家的服务器环境是否正常

Facebook Open Platform编译FAQ

facebook open platform在编译中会碰到一些问题,给大家汇总一下,可能不全,但基本都是我在编译中碰到的,希望对大家有帮助

1:下载源码:http://developers.facebook.com/fbopen/

2:根据readme的说明,把fbml所需的软件下载到dependencies目录下

3:fbml的php扩展的编译,本身有个脚本,不过一般情况下都不能顺利通过那脚本编译成功

错误提示1:

gconvert.c:48:2: error: #error GNU libiconv not in use but included iconv.h is from libiconv

解决办法:
修改build-all.py
'glib-2.14.6.tar.gz': ("./configure", "make", "sudo make install"),

改成

'glib-2.14.6.tar.gz': ("./configure --with-libiconv=gnu", "make", "sudo make install"),


错误提示2:

nspr4 -lpthread -ldl -L../../dist/bin -lmozjs  -L/usr/local/lib   -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0    -L/usr/local/lib   -lcairo    -Wl,--version-script -Wl,../../build/unix/gnu-ld-scripts/components-version-script -Wl,-Bsymbolic -ldl -lm   
../../dist/lib/libgkconcvs_s.a(nsCanvasRenderingContext2D.o)(.text+0xa47): In function `nsCanvasRenderingContext2D::Destroy()':
: undefined reference to `XFreePixmap'
../../dist/lib/libgkconcvs_s.a(nsCanvasRenderingContext2D.o)(.text+0x141a): In function `nsCanvasRenderingContext2D::SetDimensions(int, int)':
: undefined reference to `XRenderFindStandardFormat'
../../dist/lib/libgkconcvs_s.a(nsCanvasRenderingContext2D.o)(.text+0x1440): In function `nsCanvasRenderingContext2D::SetDimensions(int, int)':
: undefined reference to `XListPixmapFormats'
../../dist/lib/libgkconcvs_s.a(nsCanvasRenderingContext2D.o)(.text+0x1467): In function `nsCanvasRenderingContext2D::SetDimensions(int, int)':
: undefined reference to `XFree'
../../dist/lib/libgkconcvs_s.a(nsCanvasRenderingContext2D.o)(.text+0x149d): In function `nsCanvasRenderingContext2D::SetDimensions(int, int)':
: undefined reference to `XCreatePixmap'
collect2: ld returned 1 exit status
gmake[3]: *** [libgklayout.so] Error 1
gmake[3]: Leaving directory `/usr/home/yunfeng/facebook/facebook/fb-open-platform/libfbml-1.2.0/dependencies/mozilla/layout/build'
gmake[2]: *** [libs] Error 2
gmake[2]: Leaving directory `/usr/home/yunfeng/facebook/facebook/fb-open-platform/libfbml-1.2.0/dependencies/mozilla/layout'
gmake[1]: *** [tier_9] Error 2
gmake[1]: Leaving directory `/usr/home/yunfeng/facebook/facebook/fb-open-platform/libfbml-1.2.0/dependencies/mozilla'
make: *** [default] Error 2

解决办法:

修改dependencies/mozilla/layout/build/Makefile.inifdef

MOZ_ENABLE_GTK2EXTRA_DSO_LDOPTS += $(MOZ_GTK2_LIBS) \                                    $(NULL)

改成ifdef MOZ_ENABLE_GTK2EXTRA_DSO_LDOPTS += $(MOZ_GTK2_LIBS) \                -L/usr/X11R6/lib -lX11 -lXrender \                    $(NULL)

这个错误一般发生在firefox编译的时候,我一般都手动解压缩firefox软件,然后修改Makefile.in,然后在build-all.py中屏蔽解压缩firefox的语句就行


错误提示3:

In file included from js/jsarena.c:49:
js/jsbit.h:173: error: size of array 'js_static_assert_line_173' is negative
make[1]: *** [js/jsarena.o] Error 1
make: *** [src] Error 2

解决办法:

修改 src/js/jsbit.h 第173行 

S_STATIC_ASSERT(sizeof(unsigned long long) == sizeof(JSUword));

改成

S_STATIC_ASSERT(sizeof(unsigned long) == sizeof(JSUword));

这个错误发生在firefox编译成功后,进行fbml的编译时候发生的,如果你用build-all.py编译,不想进行前面的编译,可以根据脚本屏蔽前面的编译。

安装YUI Editor插件

使用MT最困惑我的是编辑的不方便,幸亏还略懂一些html语言,不过做为一个linux技术网站,写代码是很常见的,这就更加需要一个所见即所得的编辑器,好在MT4提供了这么一个强大的编辑器YUI Editor
安装很简单,下载最新版本的YUI Editor in Movabletype,解压后,将其中的文件上传到MT程序安装的相应目录,编辑mt-config.cgi,添加以下语句
RichTextEditor YUIEditor
大功告成!

其实类似的软件还有,比如FCKeditor,安装方法也类似,不过我觉得前者更加强大一些,FCKeditor虽然老牌,但似乎没什么更新。