1. Next, Fastdfs installed Nginx, install PHP program for development upload and call, install Fdfs PHP module, if you install PHP
Cd/usr/local/src/fastdfs-5.05/php_client//usr/local/php/bin/phpize./configure--with-php-config=/usr/local/php/ Bin/php-configmake && make INSTALLLL/USR/LOCAL/PHP-5.6.20/LIB/PHP/EXTENSIONS/NO-DEBUG-NON-ZTS-20131226/CP /usr/local/src/php-5.6.20/php.ini-production/usr/local/php/lib/phh.ini
2. Append the Fdfs file to the PHP file
Cd/usr/local/src/fastdfs-5.05/php_client/vim fastdfs_client.inicat Fastdfs_client.ini >>/usr/local/php/lib/ Ini
3. Check if PHP is normal in Fastdfs
[Email protected] fdfs]#/usr/local/php/bin/php/usr/local/src/fastdfs-5.05/php_client/fastdfs_test.php 5.05fastdfs_tracker_make_all_connections Result:1array (1) { ["G1"]=> int (0) file exist:1token= F6aeb826add3678e438582ca65683443file Content:thisisatest. (Storage_download_file_to_file1 result:1storage_set_metadata1 result:1string ()) "G1/m00/00/00/ RBABKVe8AKKAJpMZAAAAD61kmgs955.part2.txt "Delete file G1/m00/00/00/rbabkve8akkajpmzaaaad61kmgs955.part2.txt return : 1delete file G1/m00/00/00/rbabkve8akkajpmzaaaad61kmgs955.bin Return:1bool (True) tracker_close_all_connections Result:1
4.php Client Testing
[[email protected] web_test]# echo ' php_upload_test ' >/tmp/upload.txt[[email protected] web_test]# vim test.php <?php var_dump (function_exists (' fastdfs_storage_upload_by_filename ')); $ret = Fastdfs_storage_upload_by_filename ('/tmp/upload.txt '); Var_dump ($ret);?>
5. Upload Effect
[[email protected] web_test]#/usr/local/php/bin/php Test.phpbool (True) array (2) { ["group_name"]=> String (2) "G1" ["filename"]=> string "M00/00/00/rbabkve4oo6azt5naaaaeixdrhw352.txt"}
Http://192.168.1.29/G1/M00/00/00/rBABKVe4oo6AZT5NAAAAEIxdRHw352.txt
FastDFS-5.05 Tracker Server Installation nginx+php