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

1.下载SDK

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

shell 复制代码
git clone https://github.com/pangdahua/php7-wxwork-finance-sdk

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

3.编译之前准备

  • 将SDK文件夹上传至服务器,放在/usr/local/src下,即完整路径为/usr/local/src/php7-wxwork-finance-sdk
  • 在终端执行,设置临时变量
shell 复制代码
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

shell 复制代码
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`
shell 复制代码
.......
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'.
shell 复制代码
[root@test php7-wxwork-finance-sdk]# make install 
Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-zts-20170718/

5.php.ini添加扩展

shell 复制代码
extension=wxwork_finance_sdk.so
相关推荐
石像鬼₧魂石1 小时前
内网渗透靶场实操清单(基于 Vulhub+Metasploitable 2)
linux·windows·学习·ubuntu
橘子真甜~2 小时前
C/C++ Linux网络编程15 - 网络层IP协议
linux·网络·c++·网络协议·tcp/ip·计算机网络·网络层
拾贰_C3 小时前
【Linux | Windows | Terminal Command】 Linux---grep | Windows--- findstr
linux·运维·服务器
阿华hhh4 小时前
Linux系统编程(标准io)
linux·开发语言·c++
石像鬼₧魂石5 小时前
Kali Linux 网络端口深度扫描
linux·运维·网络
alengan5 小时前
linux上面写python3日志服务器
linux·运维·服务器
Rose sait5 小时前
【环境配置】Linux配置虚拟环境pytorch
linux·人工智能·python
叶之香6 小时前
CentOS/RHEL 7、8安装exfat和ntfs文件系统
linux·运维·centos
一世琉璃白_Y6 小时前
pg配置国内数据源安装
linux·python·postgresql·centos