编译企业微信会话内容存档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
相关推荐
网络安全-杰克几秒前
关于网络安全里蜜罐的详细介绍
安全·web安全·php
不是三毛没有半20 分钟前
Centos 7 安装wget
linux
叫我龙翔1 小时前
【计网】实现reactor反应堆模型 --- 多线程方案优化 ,OTOL方案
linux·运维·网络
mit6.8241 小时前
[Docker#9] 存储卷 | Volume、Bind、Tmpfs | -v/mount | MySQL 灾难恢复 | 问题
linux·运维·docker·容器·架构
WangYaolove13141 小时前
请解释Python中的装饰器是什么?如何使用它们?
linux·数据库·python
7yewh2 小时前
嵌入式硬件实战提升篇(一)-泰山派RK3566制作多功能小手机
linux·arm开发·驱动开发·嵌入式硬件·物联网·智能手机·硬件架构
YRr YRr2 小时前
ubuntu ros 解决建完图后 保存的地图非常小的问题
linux·运维·ubuntu
脸ル粉嘟嘟2 小时前
常用命令之Linux&Oracle&Hive&Python
linux·hive·oracle
Wils0nEdwards3 小时前
Leetcode 整数转罗马数字
linux·python·leetcode
云空3 小时前
《InsCode AI IDE:编程新时代的引领者》
java·javascript·c++·ide·人工智能·python·php