编译企业微信会话内容存档PHP版SDK扩展

1.下载SDK

如果克隆不了,就页面下载

git clone https://github.com/pangdahua/php7-wxwork-finance-sdk

2.下载企微官网C版本的最新sdk文件

  • 下载地址:https://wwcdn.weixin.qq.com/node/wework/images/sdk_20201116.rar

  • 下载以后将解压之后的文件夹里libWeWorkFinanceSdk_C.soWeWorkFinanceSdk_C.h复制到php7-wxwork-finance-sdk文件夹中。

3.编译之前准备

  • 将SDK文件夹上传至服务器,放在/usr/local/src下,即完整路径为/usr/local/src/php7-wxwork-finance-sdk
  • 在终端执行,设置临时变量
PHP_CONFIG="/usr/local/php/bin/php-config"
PHP_WXWORK_FINANCE_SDK="/usr/local/src/php7-wxwork-finance-sdk"

4.开始编译

PHP安装目录根据自己的实际场景修改,我的PHP安装在/usr/local/php

cd /usr/local/src/php7-wxwork-finance-sdk

# 生成configure文件
phpize   #如果phpize没有设置软连接,需要完整路径执行即/usr/local/php/bin/phize

# 开始编译
./configure --with-php-config=$PHP_CONFIG --with-wxwork-finance-sdk=$PHP_WXWORK_FINANCE_SDK

# 如果没有报错的话,就可以执行`make && make install`
.......
xwork_finance_sdk.so
creating wxwork_finance_sdk.la
(cd .libs && rm -f wxwork_finance_sdk.la && ln -s ../wxwork_finance_sdk.la wxwork_finance_sdk.la)
/bin/sh /usr/local/src/wxwork-finance/libtool --mode=install cp ./wxwork_finance_sdk.la /usr/local/src/wxwork-finance/modules
   ./.libs/wxwork_finance_sdk.so /usr/local/src/wxwork-finance/modules/wxwork_finance_sdk.so
cp ./.libs/wxwork_finance_sdk.lai /usr/local/src/wxwork-finance/modules/wxwork_finance_sdk.la
PATH="$PATH:/sbin" ldconfig -n /usr/local/src/wxwork-finance/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/src/wxwork-finance/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.
Don't forget to run 'make test'.
[root@test php7-wxwork-finance-sdk]# make install 
Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-zts-20170718/

5.php.ini添加扩展

extension=wxwork_finance_sdk.so
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值