当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
1 Star 1 Fork 1

yoby / php7扩展开发
关闭

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

c/c++语言扩展php函数

php-x开发dll插件框架

  • 生成扩展是php_dump.dll
  • 方法有两个 dump([1,2]) dump(1) //支持对象,变量,数组打印 jsonx(200,"请求成功",[1,2],10) //输出json格式,支持跨域,参数:状态码,说明,数据,数据条数 { "code": 200, "msg": "成功", "list": [], "total": 0 }
  • 版本列表 php7.2 php7.3 php7.4

编译dll

编译步骤 打开vs2017新建-从现有代码创建-项目名称dump 选择动态链接库,然后切换一下解决方案为release,x64 右键配置属性C/C++,附加包含目录

C:\app\php-sdk\phpdev\vc15\x64\php-src
C:\app\php-sdk\phpdev\vc15\x64\php-src\TSRM
C:\app\php-sdk\phpdev\vc15\x64\php-src\main
C:\app\php-sdk\phpdev\vc15\x64\php-src\Zend

C/C++预处理器

ZEND_DEBUG=0
PHP_EXTENSION
PHP_WIN32
ZEND_WIN32
HAVE_EXT_CPP=1
COMPILE_DL_EXT_CPP
ZEND_WIN32_KEEP_INLINE
ZTS #不添加就是关闭安全,一般不加

\win32\build\文件夹里找到“config.w32.h.in”,将这个文件复制到E:\php7\main\文件夹里,去掉后面的“.in” 右键项目属性,连接器,输入,附加依赖项,编辑,将php7.lib的路径放进去(这个文件在php编译后的程序文件夹里,根目录的dev文件夹里路径C:\app\php-sdk\php\dev\php7.lib 编译生成的是NTS版本 在x64\Release\下面有ext_cpp.dll 需要改名字php_ext_cpp.dll,所有模块在前面加上php_然后在php.ini配置写上extension=cpp_ext

MIT License Copyright (c) 2019 yoby Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

fun扩展库和dump库,使用php-x开发,vs2017编译,开发语言C++,php扩展开发 展开 收起
C++
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C++
1
https://gitee.com/yoby/fun.git
git@gitee.com:yoby/fun.git
yoby
fun
php7扩展开发
master

搜索帮助