如何使用 cygwin/mingw 在 windows 上编译 PHP 扩展? [英] How do you compile a PHP extension on windows with cygwin/mingw?

查看:56
本文介绍了如何使用 cygwin/mingw 在 windows 上编译 PHP 扩展?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建 RabbitMQ PHP 包装器AMPQ PHP 包装器 在 Windows (64) 上使用 Cygwin.我已经成功构建了底层 C 库(librabbitmq.dll),但我被困在phpize"步骤:

I am trying to build the RabbitMQ PHP wrapper and the AMPQ PHP wrapper on Windows (64) using Cygwin. I have successfully built the underlying C library (librabbitmq.dll) but I am stuck at the 'phpize' step:

phpize &&./configure --with-rabbit &&制作&&须藤制作安装

如果我理解正确,windows 上没有phpize",那么我该如何构建我的 PHP 包装器?

If I understand correctly, there is no 'phpize' on windows, so how do I build my PHP wrapper?

请注意,我完全不熟悉构建 PHP 扩展(无论是在 linux 还是 windows 上).

Note that I'm totally new to building PHP extensions (be it on linux or windows).

推荐答案

这完全不受支持.PHP 被设计为在 UNIX/POSIX 系统上用 GNUmake 编译,在 Windows 系统上用 Visual C++ 编译.

This is totally not supported. PHP is designed to be compiled with GNUmake on UNIX/POSIX systems and Visual C++ on Windows systems.

实际上,您唯一的选择是下载 Microsoft Visual Studio 2008 Express(2010 不是据我所知,目前已获得工作许可).

Your only option, really, is to download Microsoft Visual Studio 2008 Express (2010 is not certified to work at present, to my knowledge).

然后您可以链接到在您自己的自定义扩展中使用 mingw 编译的 dll.试试这个堆栈溢出指南:来自 MinGW 静态库(.a) 到 Visual Studio 静态库 (.lib).

You can then link to dlls compiled using mingw in your own custom extension. Try this Stack Overflow guide: From MinGW static library (.a) to Visual Studio static library (.lib).

这篇关于如何使用 cygwin/mingw 在 windows 上编译 PHP 扩展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆