如何为PHP应用程序开发C扩展? [英] How to develop C extensions for PHP apps?

查看:122
本文介绍了如何为PHP应用程序开发C扩展?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的PHP应用程序具有一个数字运算部分,这对于PHP来说很慢,所以我当时想构建一个自定义的C扩展名,但是不可能找到以:(

My PHP app has a number-crunching part that is just to slow for PHP, so I was thinking of building a custom C extension, but it is impossible to find any good reference to start with :(

是否有关于如何执行此类操作的指南?

Is there a guide on how to do something like this?

推荐答案

最好的资源是 PHP文档.另一方面, PHP Wiki 上的内容是最新的,但是也很不完整,并且不太适合初学者.另请参见这些文章

The best resource, although outdated in several aspects (it only covers PHP until version 5.1) is Extending and Embedding PHP by Sara Golemon. Even more outdated is the PHP documentation. On the other hand, the content on the PHP wiki is very up-to-date, but also quite incomplete and not very oriented for beginners. See also these articles, part V of Advanced PHP Programming by George Schlossnagle, chapter 14 of Programming PHP by Rasmus Lerdorf and Kevin Tatroe and, specially, these slides.

最后,您将找到的最权威的资源是与PHP捆绑在一起的扩展程序的源代码.

Finally, the most authoritative source you'll find is the source code of the extensions bundled with PHP.

这篇关于如何为PHP应用程序开发C扩展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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