【发布时间】:2021-10-06 21:32:52
【问题描述】:
我尝试为代码加密目的制作自定义 php 扩展,
我按照本教程制作了一个自定义扩展:How to make a PHP extension
我在编译扩展时收到此警告:
WARNING
The following arguments is invalid, and therefore ignored:
--enable-php-helloworld
我都是按照教程做的,我是在windows上构建的。
我可能做错了什么。
我关注了那个部分:https://stackoverflow.com/a/32575493/3103078
我 1:1 复制了代码(操作系统:Windows)
使用的命令:
phpize
configure --enable-php-helloworld
nmake
php -d extension=php_helloworld.so --re php_helloworld
预期结果:
>>>helloworld support
实际结果:
>>>
复制:
mkdir php
start https://altushost-swe.dl.sourceforge.net/project/winflexbison/win_flex_bison3-latest.zip
set path=%path%;C:\your_path\to\bison
start https://altushost-swe.dl.sourceforge.net/project/gnuwin32/sed/4.2.1/sed-4.2.1-bin.zip
set path=%path%;C:\your_path\to\sed
start https://codeload.github.com/skvadrik/re2c/zip/refs/tags/2.1.1
set path=%path%;C:\your_path\to\re2c
start https://download.microsoft.com/download/5/C/3/5C3770A3-12B4-4DB4-BAE7-99C624EB32AD/windowssdk/winsdksetup.exe
rem after install
set path=%path%;C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64
start https://windows.php.net/downloads/releases/php-devel-pack-7.3.29-Win32-VC15-x64.zip
rem install upper in php dir
phpize
configure --enable-php-helloworld
nmake
php -d extension=php_helloworld.so --re php_helloworld
【问题讨论】:
-
那篇文章中有很多不同的信息。您执行的具体步骤是什么?请提供准确和准确的信息。请参阅:How to create a Minimal, Reproducible Example 和 How to ask。
-
你应该分享你的代码,你编译的步骤是什么?你说“我遵循了本教程”——但如果教程是准确的(可能不是),那么你不可能遵循所有的步骤,对吧?
-
我添加了其他信息
-
你还没有分享你的代码。这不是一个最小的、可重复的例子。
-
我现在提供了一个复制指南