–xinclude: Command not found

编译heartbeat时出现–xinclude: Command not found错误,这时由于缺少libxslt-devel包。安装好后,重新./configure再make即可。

  1. yum install libxslt-devel
  2. make clean
  3. ./configure
  4. make && make install

glue_config.h:99:1: error: “HA_HBCONF_DIR” redefined

编译Heartbeat时出现,glue_config.h:99:1: error: “HA_HBCONF_DIR” redefined。这是由于glue和heartbeat的版本不兼容的问题。
解决方法:
删除/usr/local/heartbeat/include/heartbeat/glue_config.h的最后一行:#define HA_HBCONF_DIR “/usr/local/heartbeat/etc/ha.d/”

./.libs/libplumb.so: undefined reference to

编译Cluster Glue时发生如下错误:

  1. ./.libs/libplumb.so: undefined reference to `uuid_parse’
  2. ./.libs/libplumb.so: undefined reference to `uuid_generate’
  3. ./.libs/libplumb.so: undefined reference to `uuid_copy’
  4. ./.libs/libplumb.so: undefined reference to `uuid_is_null’
  5. ./.libs/libplumb.so: undefined reference to `uuid_unparse’
  6. ./.libs/libplumb.so: undefined reference to `uuid_clear’
  7. ./.libs/libplumb.so: undefined reference to `uuid_compare’
  8. collect2: ld returned 1 exit status

解决方法:

  1. yum install e2fsprogs-devel
  2. make clean
  3. ./configure
  4. make && make install

php sockets扩展安装

今天安装cacti发现需要php sockets扩展,而现在的lnmp没有安装,于是想到了phpize工具安装扩展,安装方法如下:

  1. cd php-5.3.8/ext/sockets/
  2. /usr/local/php/bin/phpize
  3. ./configure –enable-sockets –with-php-config=/usr/local/php/bin/php-config
  4. make
  5. make install

接着在/etc/php.ini添加加载扩展代码:

  1. extension=sockets.so

service php-fpm reload或service httpd reload

suffix or operands invalid for `cmpxchg’

今天编译安装glib,在make时出现suffix or operands invalid for `cmpxchg’错误,谷歌了一下,发现问题应该是cpu是64位的,系统是32位的,所以就出现了这个错误,解决方法是在./configure时加上参数–build=i686即可。

ERROR: module is read only

执行rsync出现如下错误:
rsync: writefd_unbuffered failed to write 4 bytes to socket [sender]: Connection reset by peer (104)
ERROR: module is read only
rsync error: syntax or usage error (code 1) at main.c(866) [receiver=3.0.6]
rsync: connection unexpectedly closed (5 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]

关键的错误信息是:ERROR: module is read only

解决方法:在rsync.conf文件中加入read only=no。

undefined reference to `libiconv_open’ collect2: ld returned 1 exit status错误

今天有一网友反映使用lnmp一键安装包无法安装php,叫他发错误文件给我看,发现提示这样的错误:

  1. undefined reference to `libiconv_open’
  2. collect2: ld returned 1 exit status

这个错误的原因可能php找不到iconv库文件,所以我们需要下载安装它。

  1. #wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
  2. #tar -zxvf libiconv-1.14.tar.gz
  3. #cd libiconv-1.14
  4. # ./configure –prefix=/usr/local/libiconv
  5. # make
  6. # make install

完成之后在编译php的./configure命令加上–with-iconv=/usr/local/libiconv指向iconv位置。
这样应该能解决这个问题。

php apc加速器安装

一、简介
APC,全称是Alternative PHP Cache,官方翻译叫”可选PHP缓存”。
其主要功能有两个,一是对PHP opcode缓存,二是可以做内存缓存功能。 对apc进行配置主要基于两点, 一是给APC分配多少内存,另一个每次请求如果PHP文件被修改apc是否做检查。 APC的源码包自带了一个apc.php,可以将这个文件上传到web服务器的某个目录下,用浏览器访问,这会显示当前的状态。我们可以从这里的表格分析当前的缓存状况,作出进一步优化.
二、安装APC
下载:http://pecl.php.net/package/APC

  1. /usr/local/php/bin/phpize
  2. ./configure –enable-apc –with-php-config=/usr/local/php/bin/php-config
  3. make
  4. make install

三、示例配置
以php5.3.x为例

  1. extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/"
  2. extension = apc.so
  3. ; APC
  4. apc.enabled = 1
  5. apc.shm_segments = 1
  6. apc.shm_size = 64M
  7. apc.optimization = 1
  8. apc.num_files_hint = 0
  9. apc.ttl = 0
  10. apc.gc_ttl = 3600
  11. apc.cache_by_default = on

详细的配置介绍:
http://cn.php.net/manual/en/apc.configuration.php