fastdfs php client,centos 5.7_64位下FastDFS_client的配置和PHP测试

client    server5 192.168.10.229

client server 先安装LNMP环境

cd  /root/soft/FastDFS/php_client

/usr/local/php-5.2.17/bin/phpize

./configure --with-php-config=/usr/local/php-5.2.17/bin/php-config

make

make install

#copy lib file to php extension directory, eg. /usr/lib/php/20060613/

cp modules/fastdfs_client.so  /usr/local/php-5.2.17/lib/php_extensions/

编辑/usr/local/php-5.2.17/etc/php.ini增加

extension=/usr/local/php-5.2.17/lib/php_extensions/fastdfs_client.so

; the base path

fastdfs_client.base_path = /tmp

; connect timeout in seconds

; default value is 30s

fastdfs_client.connect_timeout = 2

; network timeout in seconds

; default value is 30s

fastdfs_client.network_timeout = 60

; standard log level as syslog, case insensitive, value list:

;;; emerg for emergency

;;; alert

;;; crit for critical

;;; error

;;; warn for warning

;;; notice

;;; info

;;; debug

fastdfs_client.log_level = info

; set the log filename, such as /usr/local/fastdfs/logs/fastdfs_client.log

; empty for output to stderr

fastdfs_client.log_filename =

; secret key to generate anti-steal token

; this parameter must be set when http.anti_steal.check_token set to true

; the length of the secret key should not exceed 128 bytes

fastdfs_client.http.anti_steal_secret_key =

; FastDFS cluster count, default value is 1

fastdfs_client.tracker_group_count = 1

; config file of FastDFS cluster ;, based 0

; must include absolute path, such as fastdfs_client.tracker_group0

; the config file is same as conf/client.conf

fastdfs_client.tracker_group0 = /etc/fdfs/client.conf

编辑完重启FASTCGI生效

/etc/init.d/fastcgi restart

重启后,可以用PHPINFO可以看到fastdfs模块已经加载

解压后方到WWW目录

访问http://192.168.10.229/index.php

上传文件测试,反回提示正常

array(2) { ["group_name"]=> string(6) "group1" ["filename"]=> string(44) "M00/00/04/wKgK5E9q6IfVorO9AAAnYuwdBOc552.jpg" }

查看一下MYSQL数据库,里面有记录地址

id  file_id                                    group_id    real_name   storage_ip

3 M00/00/04/wKgK5E9q6IfVorO9AAAnYuwdBOc552.jpg group1      1.jpg       192.168.10.228

测试完成

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值