是否存在已编译的 PHP 脚本?
我想知道是否有人使用或阅读过编译为 Apache .so 扩展名的 PHP 脚本...事情是我想我记得在某处读过它,但不知道这样的东西是否存在。
这看起来很有希望,但不完整并被放弃: http://phpcompiler.org/
我感兴趣,因为我认为它可以提高性能...也许有人可以指出一个框架或 apache 扩展可以做到这一点。
谢谢!!
I am wondering if anyone has used or read about PHP scripts compiled as a .so extension for Apache... Thing is I think I remember reading about it somewhere but dont know if such a thing exists.
This looks promising, but incomplete and abandoned: http://phpcompiler.org/
Im interested because i think it could improve performance... Perhaps someone could point out a framework or apache extension that does this.
Thanks!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
它们确实存在。 Facebook 提供了用于 PHP 的 HipHop 编译器。
不过我不知道它是否适用于 Apache。
您可能想看一下:http://developers.facebook.com/blog/post/第358章
Github 存储库:http://github.com/facebook/hiphop-php
They do exist. There's HipHop Compiler for PHP by Facebook.
I don't know if it works with Apache, though.
You may want to take a look: http://developers.facebook.com/blog/post/358
Github repository: http://github.com/facebook/hiphop-php
如果您想以这种方式提高 PHP 脚本的性能,您应该尝试 Zend Accelerator。它保留了字节码,因此不必在每个请求时重新编译。
If you want to improve the performance of your PHP scripts in this way, you should try something like Zend Accelerator. It keeps the bytecode around so it doesn't have to be recompiled on every request.
这是一个非常有负担的问题。是的,如果您每小时处理超过一百万次点击,那么编译 PHP 会带来非常实际的好处(请参阅有关 HipHop 的其他答案)。但如果您真的想问“如何提高网站的性能”,那么这可能是任何人应该给您的最后一个答案。
如果您的目标是让您的网站运行得更快,那么您首先需要建立捕获服务请求所需时间的方法(最好将网络和数据库时间与网络服务器时间分开),以及捕获页面转动时间(即加载页面上所有内容所需的时间),然后查看以下内容:
。
C.
This is a very loaded question. Yes, if you are handling more than a million hits per hour, then there are very real benefits in compiling PHP (see other answers about HipHop). But if you really meant to ask "how do I improve the performance of my website" then that's probably the last answer anyone should give you.
If you're objective is to make your site go faster, then you first need to establish methods of capturing the time it takes to service a request (preferably seperating network and database time from webserver time), and for capturing page turn times (i.e. the time it takes to load all the content on a page) then look at stuff like:
etc.
C.