php fastdfs扩展安装

[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