php-beast-binaries
php-beast-binaries copied to clipboard
大神,能否发布一下php-beast的windows源码?
使用 header.c 文件可以修改 php-beast 加密后的文件头结构,这样网上的解密软件就不能认识我们的加密文件,就不能进行解密,增加加密的安全性
原作者建议修改header.c的文件头结构,增加安全性,希望大神能发布php-beast的windows源码,不胜感激!
https://github.com/liexusong/php-beast 这个里面的代码本身就是兼容windows的
你直接在vs里面编译就好了
我在VC2012里编译试过,编译遇到一些问题,我是做php和java开发的,对C不是很擅长...我再试试,谢谢
你在群里问一下吧,有个群友写了一个详细的编译文档,按着文档来就好了
哪个群?方便提供一下吗?
看到你在群里了
你那里有编译的文档吗?能发一份吗?
没有,你群里问一下
群共享里面都有
群号是什么?
@yuditxj 239243332
@imaben 群满了,加不了。 求个自助编译的文档撒.
已放弃 php-beast 推荐使用:Swoole Compiler
@niqingyang 前天折腾了半天,自己编译过了。 Swoole Compiler了解过,小项目还没收入啊。 等有了收成,再购买它。
Windows编译PHP拓展
1.离线下载并安装Build Tools
(对应Visual Studio 2017
)
下载连接:vs_buildtools.exe 离线下载脚本:
vs_buildtools.exe --layout E:\VS2017BuildTools --add Microsoft.VisualStudio.Workload.VCTools --lang zh-CN
2. 下载,解压PHP-SDK
工具包
https://github.com/Microsoft/php-sdk-binary-tools
3. PHP-SDK
配置,加载
# 命令行进入解压路径,按自己需求执行对应的批处理脚本
>phpsdk-vc15-x64.bat
$> phpsdk_buildtree phpdev
4. 下载PHP-SDK
编译依赖组件
$> phpsdk_deps -u
# 或手工下载([依赖下载链接](https://windows.php.net/downloads/php-sdk/deps))并解压至deps目录
# 下载目录对应当前上级目录文件名
5. 下载,复制PHP源码,下载,复制扩展源码。
- 可在当前目录下载,解压多个PHP版本的源码。
- vc## 编译工具版本(eq vc15),x## CPU版本 (x86 or x64)
- 解压复制PHP源码至phpdev\vc##\x##\php-7.3.7-src
- 解压复制扩展源码至phpdev\vc##\x##\php-7.3.7-src\ext或phpdev\vc##\x##\pecl
- beast扩展需要复制
win95nt.h
至php-7.3.7-src\main
目录。(此文件建议下载一个PHP7.1x的源码,在main目录。)
务必修改beast
源码文件config.w32
,替换为如下内容。源码有错误,作者后期新加的代码漏了execute-normal-script
配置信息:
// $Id$
// vim:ft=javascript
// If your extension references something external
ARG_WITH("beast", "for beast support", "yes,shared");
ARG_ENABLE("beast", "enable beast support", "yes,shared");
ARG_ENABLE("beast-debug", "enable beast debug mode", "no");
ARG_ENABLE("execute-normal-script", "Enable execute normal PHP script", "yes");
if (PHP_BEAST != "no") {
if (PHP_BEAST_DEBUG != "no") {
AC_DEFINE('BEAST_DEBUG_MODE', 1, 'Debug support in beast');
}
if (PHP_EXECUTE_NORMAL_SCRIPT != "no") {
AC_DEFINE('BEAST_EXECUTE_NORMAL_SCRIPT', 1, [ ]);
}
EXTENSION("beast", "beast.c aes_algo_handler.c des_algo_handler.c base64_algo_handler.c beast_mm.c spinlock.c cache.c beast_log.c global_algo_modules.c header.c networkcards.c tmpfile_file_handler.c file_handler_switch.c shm.c", true);
}
6. 编译扩展
$>cd php-7.3.7-src
$>buildconf
$>configure --help #查找编译扩展关键字,确定配置参数
# 线程安全编译
$>configure --disable-all --enable-cli --without-beast --enable-execute-normal-script=yes --disable-beast=shared && nmake
# 非线程安全编译
$>configure --disable-zts --disable-all --enable-cli --without-beast --enable-execute-normal-script=yes --disable-beast=shared && nmake
重新编译脚本
# Recompile after you have done some changes
1. Clean up old compiled binaries
nmake clean
2. If you need to update the 'configure' script
buildconf --force
3. Create your makefile: see release
configure --disable-all --enable-cli --enable-$remains
4. Compile
nmake
引用资源
- 在windows10下php7.3+编译phalcon扩展 https://www.jianshu.com/p/9dca99f7d4a9
- Windows编译PHP7.2拓展 https://segmentfault.com/a/1190000016011547
- https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2
你直接在vs里面编译就好了
你好,请教一下,目前PHP用的版本是5.6,应该如何生成dll呢?试了好多网上的方案,都不行,还请指导一下 ,谢谢。
@jenawant 5.6我这也没有成功,放弃5.6了。我编译环境太多,最后再没折腾。 服务器自己有权折腾,就升级吧,同样的代码7.x性能好的不得了(开启opcache)。
@Refactoring
感谢回复,基于你的方案,然后参考PHP官方文档,在5.6.40下编译成功了,谢谢。 接受你的建议,接下来,要搞PHP7的版本。
引用资源:http://ishere.cn/2019/12/05/windows10-compile-php-extension.html