#################################################################################################
mysql的安装 mysql-5.5.22.tar.gz
http://www.cmake.org/files/v2.8/cmake-2.8.8.tar.gz
groupadd mysql
useradd -g mysql mysql
tar zxvf mysql-5.5.22.tar.gz
cd mysql-5.5.22/
make出错:
/usr/include/png.h:434:24: error: pnglibconf.h: No such file or directory
解决方法
vi /usr/include/png.h 到434行修改为下面格式就可以了
#include "/usr/libpng/include/pnglibconf.h"
/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c: In function '_php_image_stream_putc':
/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c:51: error: 'struct gdIOCtx' has no member named 'data'
/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c: In function '_php_image_stream_putbuf':
/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c:58: error: 'struct gdIOCtx' has no member named 'data'
/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c: In function '_php_image_stream_ctxfree':
/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c:67: error: 'struct gdIOCtx' has no member named 'data'
/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c:68: error: 'struct gdIOCtx' has no member named 'data'
/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c:69: error: 'struct gdIOCtx' has no member named 'data'
In file included from /usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd.c:103:
/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c: In function '_php_image_output_ctx':
/usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/gd_ctx.c:153: error: 'gdIOCtx' has no member named 'data'
make: *** [ext/gd/gd.lo] Error 1
could not read symbols: Bad value
经网上一查,如果系统是64位,需要用64位元的方法进行编译zlib如下:
[root@serv-169 usr]# CFLAGS="-O3 -fPIC" ./configure --prefix=/usr/zlib
[root@serv-169 usr]# make
[root@serv-169 usr]# make install
[root@serv-169 usr]# make clean
现在在来编译php试试
make
make install
已经成功编译安装。
[root@serv-169 LAMP+memcahed+catci]# tar zxf sources/memcache-2.2.6.tgz
[root@serv-169 LAMP+memcahed+catci]# cd memcache-2.2.6/
[root@serv-169 memcache-2.2.6]# /usr/php/bin/phpize
[root@serv-169 memcache-2.2.6]# ./configure -enable-memcache --prefix=/usr/memcache \
--with-php-config=/usr/php/bin/php-config --with-zlib-dir=/usr/zlib
[root@serv-169 memcache-2.2.6]# make
报错了
/usr/local/src/LAMP+memcahed+catci/memcache-2.2.6/memcache.c:2232: error: too few arguments to function 'zend_list_insert'
/usr/local/src/LAMP+memcahed+catci/memcache-2.2.6/memcache.c:2250: error: too few arguments to function 'zend_list_insert'
make: *** [memcache.lo] Error 1
这个是什么原因呢,回去看看configure的时候有什么警告没。这里果然有个警告:
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
提示缺少re2c,到网上去找一个装上(注意这里用的是64位的,在下载的时候要根据你的操作系统位数来选择)。
可用地址:http://pkgs.repoforge.org/re2c/re2c-0.13.5-1.el6.rf.x86_64.rpm
装上以后configure的时候就不会报错了,可以看到这样的提示:
checking for re2c... re2c
checking for re2c version... 0.13.5 (ok)
./configure --prefix=/usr/rrdtool
make
make install
net-snmp安装 net-snmp-5.7.1.tar.gz
tar zxvf net-snmp-5.7.1.tar.gz
cd net-snmp-5.7.1
./configure --prefix=/usr/net-snmp
make
make install
这里make的时候错误提示为:
no rule to make target '../sedscript',needed by 'agentxtrap.1' stop.
make *** [installsubdirs] error 1
解决方法,下载net-snmp-5.0.9-2.90.1.1.src.rpm安装后,重新编译安装net-snmp.
cd /usr/apache/htdocs/
导入cacti数据库
mysql -u cacti -pcacti123 cacti < cacti.sql
导入完成以后,修改该一下cacti的配置文件,以保证网站与数据库能正常连接。
vi /usr/apache/htdocs/cacti-0.8.8/include/config.php
然后,在浏览器访问http://192.168.0.169/cacti,这里比较麻烦,我重点说一下。我在这里总共出现四个问题,依次是:
1.页面报错为:
FATAL:cannot connect to mysql server on 'localhost',please mak sure you have specified a valid mysql database name in 'include/config.php'
解决办法:写一个脚本测试连接,代码如下:
<?php
?>
2.我测试的的时候又出现一个新的错误:
through socket 'var/mysql'
no mysql-link resource supplied
这个问题有可能是php没有找到mysql的sock文件,因为标准的php配置是通过'/tmp/mysql.sock'来连接mysql的。也有可能是权限的问题,
我的解决办法是:修改mysql的配置文件,client和mysqld的socket文件修改为php所支持的路径 /tmp/mysql.sock.重启mysql就好了。
当然也可修改php.ini文件。
3.虽然前面两个问题没有出现了,但是郁闷之极,问题总是不断的:
错误提示:strtotime():it is not safe torely on the systme's timezone sttings
时区错误,这个时区好像不是系统的那个时区,而是php的。解决办法:
修改php.ini文件的时区设置,我的是date.timezone= "Asia/Chongqing"
保存,并重启系统,再继续访问。
4.现在出现一个比较严重的问题了。安装php的时候没有配置socket支持。
这下没办法了,只能添加socket支持重新编译。
步骤如下:
1.不用停止 apache
2.进入 apache 的模块目录,备份一下 php 模块.
cd /usr/apache/modules/
cp libphp5.so libphp5.so.bak
3.进入 php 的源码目录下,由于已经成功编译过,会有一个成功的 config.nice 文件,打开这个文件并重新配置,增加 socket 支持
如果不知道 socket 支持需要哪些参数,可以通过 ./configure --help|grep sock 这个命令得到该项帮助
cd /usr/local/src/LAMP+memcahed+catci/php-5.4.0/
vi config.nice
复制原来的代码到剪切板
我的代码如下:
#! /bin/sh
#
# Created by configure