tonyenc加密扩展使用方法

第一步:下载扩展文件

root@iZ2ze4:/www/wwwroot# git clone https://github.com/lihancong/tonyenc.git

第二步:修改密文

在tonyenc文件夹下core.h文件

第三步:生成扩展文件

1、cd 到tonyenc文件夹下

2、输入命令  phpize

root@iZ2ze4vksr60:/www/wwwroot/tonyenc# phpize
Configuring for:
PHP Api Version:         20170718
Zend Module Api No:      20170718
Zend Extension Api No:   320170718

3、输入命令 find / -name php-config  获取到路径

root@iZ2ze4vksrZ:/www/wwwroot/tonyenc# find / -name php-config
/www/server/php/72/bin/php-config

4、输入命令 ./configure --with-php-config=/www/server/php/70/bin/php-config  加黑的就是 find / -name php-config找到的php的路径

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h

5、输入命令make  命令完会生成一个modules/tonyenc.so 文件的文件

Libraries have been installed in:
   /www/wwwroot/tonyenc/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

6、输入命令 make test  

第四步:部署扩展

1、将扩展放到php的扩展目录

2、修改php.ini  加入一行  重启php

第五步:加密文件

1、将需要加密的文件 放到tonyenc文件夹下 当然了,你也可以选择路径去加密,那样就直接把文件改了,切记要复制一份!!

root@iZ2ze4vksr609c7jmh:/www/wwwroot/tonyenc# php tonyenc.php HookController.php
root@iZ2ze4vksr609c7jmh:/www/wwwroot/tonyenc# 

2、执行成功之后,将文件放回原位,提示是一个二进制的文件打不开,但是可以访问使用,这就ok了!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值