php rrdtool,PHP配置rrdtool扩展 (How to build the PHP rrdtool extension)

本文详细介绍了在CentOS5.7环境下,如何编译并安装PHP的RRDTool扩展。从解压软件包到配置PHP,再到编译、安装和重启服务,每个步骤都清晰阐述,确保RRDTool扩展能够成功启用。最后,通过修改PHP配置文件并重启服务,验证RRDTool扩展的安装效果。
摘要由CSDN通过智能技术生成

服务器基本信息  CentOS 5. 7 X86_64  RRDtool 1.4.5  PHP 5.3.8

第二步 解压 php_rrdtool.tar.gz 包 移动到php 的扩展目录下我这边是(/usr/include/php/ext/)执行命令如下:

STEP 2 : Extract the php_rrdtool.tar.gz file into php extensions directory(/usr/include/php/ext/). Please use the following commands :

tar zxvf php_rrdtool.tar.gz

mv rrdtool /usr/include/php/ext/

第三步 编译,进入/usr/include/php/ext/rrdtool 运行phpize 执行命令如下:

STEP 3 : Generate configure files in order to build the PHP rrdtool. In rrdtool directory, run phpize. Please follow the below commands:

cd /usr/include/php/ext/rrdtool

phpize

./configure

第四步 执行 make 和make install 命令 STEP 4 : Build the PHP rrdtool. Just use make and make install commands.

# make

/bin/sh /usr/include/php/ext/rrdtool/libtool --mode=install cp ./rrdtool.la /usr/include/php/ext/rrdtool/modules

cp ./.libs/rrdtool.so /usr/include/php/ext/rrdtool/modules/rrdtool.so

cp ./.libs/rrdtool.lai /usr/include/php/ext/rrdtool/modules/rrdtool.la

PATH="$PATH:/sbin" ldconfig -n /usr/include/php/ext/rrdtool/modules

----------------------------------------------------------------------

Libraries have been installed in:

/usr/include/php/ext/rrdtool/modules

If you ever happen to want to link against installed libraries

in a given directory, LIBDIR, you must either use libtool, and

specify the full pathname of the library, or use the `-LLIBDIR'

flag during linking and do at least one of the following:

- add LIBDIR to the `LD_LIBRARY_PATH' environment variable

during execution

- add LIBDIR to the `LD_RUN_PATH' environment variable

during linking

- use the `-Wl,--rpath -Wl,LIBDIR' linker flag

- have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for

more information, such as the ld(1) and ld.so(8) manual pages.

----------------------------------------------------------------------

Build complete.

(It is safe to ignore warnings about tempnam and tmpnam).

# make install

Installing shared extensions: /usr/lib64/php/modules/

第五步 修改PHP配置文件添加 rrdtool.so 扩展 命令如下:

STEP 5 : Configure rrdtool.so in php configuration file.

# cd /etc/php.d/

# vi rrdtool.ini

; Enable rrdtool extension module

extension=rrdtool.so

第六步 重启服务,查看是否成功

STEP 6 : Restart apache web services.

# service httpd restart

php -m

或者使用 phpinfo() 函数来查看我们添加的扩展是否成功!

环境搭好了我们就接着看 PHP如何调用rrdtool 来实现画图滴 待续……

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值