你可以“编译” PHP代码? [英] Can you "compile" PHP code?

查看:146
本文介绍了你可以“编译” PHP代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道PHP在服务器上运行之前编译为字节码,然后可以缓存该字节代码,以便整个脚本不必在每次Web访问时重新解释。



但是你可以编译php并上传一个二进制的ish文件,这将由字节码解释器运行?

解决方案

在提出这个问题之后,Facebook推出了 PHP的HipHop ,这可能是迄今为止最好的PHP编译器世界上最大的10个网站)。



除此之外,googling PHP编译器打开了多个第三方解决方案。



Phalanger





phc




  • 编译为原生二进制文件

  • 现在不太活跃(2014年2月) - 2011年上次更新(2013年夏季最后一次更新)



Roadsend PHP Compiler





bcompiler




  • PHP的PECL扩展

  • 实验

  • 编译为PHP字节码,它在加载PHP解释器的Windows二进制文件中(请参阅 bcompiler_write_exe_footer()手动

  • 现已停产(2014年2月) - 2011年上次更改



Project Zero




  • 维基百科, a href =http://www.ibm.com/developerworks/ibm/zero/ =nofollow noreferrer> IBM

  • WebSphere sMash

  • 支持IBM

  • 编译为Java字节码

  • 现在(2014年2月)停止销售 - 网站下滑,看起来像2008年和2009年大幅炒作



Bambalam




  • 编译为独立的Windows二进制文件

  • 二进制文件包含字节码和启动器

  • 现在已中断(2014年2月) - 2006年上次更改



BinaryPHP




  • 编译为C ++

  • 现在已中止(2014年2月) - 2003年上次更改


I know that PHP is compiled to byte code before it is run on the server, and then that byte code can be cached so that the whole script doesn't have to be re-interpreted with every web access.

But can you "compile" php and upload a binary-ish file, which will just be run by the byte code interpreter?

解决方案

After this question was asked, Facebook launched HipHop for PHP which is probably the best-tested PHP compiler to date (seeing as it ran one of the world’s 10 biggest websites). However, Facebook discontinued it in favour of HHVM, which is a virtual machine, not a compiler.

Beyond that, googling PHP compiler turns up a number of 3rd party solutions.

Phalanger

phc

  • compiles to native binaries
  • not very active now (February 2014) – last version in 2011, last change in summer 2013

Roadsend PHP Compiler

bcompiler

  • PECL extension of PHP
  • experimental
  • compiles to PHP bytecode, but can wrap it in Windows binary that loads PHP interpreter (see bcompiler_write_exe_footer() manual)
  • looks discontinued now (February 2014) – last change in 2011

Project Zero

  • Wikipedia, IBM
  • incubator of changes for WebSphere sMash
  • supported by IBM
  • compiles to Java bytecode
  • looks discontinued now (February 2014) – website down, looks like big hype in 2008 and 2009

Bambalam

  • compiles to stand-alone Windows binaries
  • the binaries contain bytecode and a launcher
  • looks discontinued now (February 2014) – last change in 2006

BinaryPHP

  • compiles to C++
  • looks discontinued now (February 2014) – last change in 2003

这篇关于你可以“编译” PHP代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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