编译企业微信会话内容存档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
相关推荐
我是小灰灰吖11 分钟前
Qt 6.9.3 Ubuntu 22.04 虚拟键盘显示问题全记录与解决方案
linux·qt·ubuntu
Mortalbreeze12 分钟前
深入理解TCP协议(一):TCP报文格式详解
linux·服务器·网络·tcp/ip
三言老师24 分钟前
K8s 集群 LocalPV 静态 PV 资源手动创建实操
linux·运维·服务器·kubernetes
一直在努力学习的菜鸟34 分钟前
Rocky Linux 8.10 编译安装 PostgreSQL 17.11
linux·运维
Doraemomo1 小时前
Linux编程-进程的执行和退出
linux·运维·服务器
2601_965798471 小时前
Contractor Web Setup: Deploying Bathrooms & Kitchens Theme Fast
前端·web3·php·wordpress
lengjingzju1 小时前
编译与调试完全指南—第5章 GDB调试详解
linux
艾伦_耶格宇1 小时前
【ELK】-5 kibana和filebeat
linux·运维·ubuntu·elk
DevHub1 小时前
电视盒子刷 Armbian 教程:30 元旧盒子变 NAS 跑 Docker,200+ 机型可刷
linux·嵌入式硬件·docker·容器·开源·电视盒子
三言老师1 小时前
K8s 集群 Ceph 节点磁盘分区规划配置实操
linux·运维·数据库