php fastdfs扩展安装

本文详细介绍了FastDFS 3.06版本的安装步骤与配置方法,包括解决编译安装过程中遇到的问题,并通过验证扩展确保安装成功。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

[root@snstest ~]#tar zxvf FastDFS_v3.06.tar.gz
[root@snstest ~]#cd FastDFS
[root@ FastDFS ~]#./make.sh
[root@ FastDFS ~]#./make.sh install
[root@ FastDFS ~]#Cd client
[root@ client ~]#make; make install
[root@ client ~]#cd ../php_client

如以上不安装,直接进php-config目录进行编译安装,会报如下错误:
make: *** [fastdfs_client.lo] Error 1

[root@ php_client ~]#/usr/local/php/bin/phpize //执行php的安装目录下的phpize
[root@ php_client ~]#./configure --with-php-config=/usr/local/php/bin/php-config
[root@ php_client ~]#make
[root@ php_client ~]#make install
[root@ php_client ~]#cp ../conf/client.conf /etc/fdfs/ //3.06版本/etc/fdfs/目录下有client.conf
[root@ php_client ~]#cd /etc/fdfs/

[root@ fdfs ~]#vi client.conf,保存
tracker_server=192.168.133.171:22122 //根据环境填写IP地址及端口号

 

在php.ini配置文件中加载fastdfs
[root@ fdfs ~]#cat fastdfs_client.ini >> /usr/local/php/etc/php.ini

 

5、验证扩展

[root@ fdfs ~]#cd /opt/soft/FastDFS/php_client
[root@ fdfs ~]#cp fastdfs_test.php /var/www              ///var/www是我web服务器目录
打开IE或其它浏览器,输入http://192.168.133.87/fastdfs_test.php,如出现
3.06 fastdfs_tracker_make_all_connections result: 1 array(1) { ["group1"]=> array(12) { ["free_space"]=> int(10542) ["trunk_free_space"]=> int(0) ["server_count"]=> int(2) ["active_count"]=> int(2) ["storage_port"]=> int(23000) ["storage_http_port"]=> int(8888)

如果报以下错,就是没有重启web服务软件,如apache,nginx,fast-php
Fatal error: Call to undefined function fastdfs_client_version() in �,B on line 6

 

转载于:https://www.cnblogs.com/zenghui940/p/4932684.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值