Free PHP Compilers
Compile PHP scripts to native code, .NET or Java bytecode
Free PHP Compilers: compile PHP scripts to native code, .NET or Java bytecode
The free PHP compilers listed on this page can either compile your PHP scripts to native machine code (which can run on a computer without a PHP interpreter installed), CLI bytecode (which require the .NET or Mono framework to be installed), or Java bytecode (which require a Java virtual machine to be installed).
I have also listed some that bundle your PHP program together with a PHP interpreter and transparently (to the end-user) run your script with the interpreter on the target system. These aren't actually compilers, but are listed here since it may interest people who are looking for a way to deploy PHP scripts on other computers.
Incidentally, if obfuscating your code is your purpose, it's also possible to use a PHP encoder or obfuscator.
For the record, for the benefit of those who don't know, the official PHP interpreter can be found at the PHP: Hypertext Processor site. It's free too.
Related Pages
- How to Make / Create Your Own Website: The Beginner's A-Z Guide
- How to Register Your Own Domain Name
- How to Write a PHP Script (PHP tutorial)
- How to Install and Configure Apache, PHP, Perl and MySQL on Windows the Easy Way (with XAMPP)
- How to Prevent Email Injection in Your PHP Form-to-Mail Scripts
- How to Create and Use Cookies in PHP
- How to Point Multiple Domain Names to One Website: And How to Avoid Search Engine Problems When Doing So
Free PHP Compilers: compile PHP scripts to native code, .NET or Java bytecode
- PeachPie (Windows, macOS, Linux .NET)
PeachPie compiles your PHP code into .NET assemblies comprising CIL (short for "Common Intermediate Language", the intermediate code used in .NET programs) byte-code and meta data. The resulting binary can be run on any platform that runs .NET programs (Windows, macOS, Linux). At the time this is written, it can compile PHP 7.1 code. It is open source. PeachPie is a member of the .NET Foundation.
- RapidEXE (Windows bundle)
RapidEXE takes your console (ie, command line) PHP programs and produces a Windows executable. It is not a native code compiler, but it does its work by bundling the PHP interpreter together with your script in a single EXE file. When run, the binary automatically extracts the interpreter and supporting files, then executes the script. It also supports making an EXE file from a Python script.
- Phalanger (Windows, macOS, Linux .NET)
Phalanger compiles your PHP 5.4 code into CLI bytecode (.exe or .dll) that can be run under the .NET 4.0 or Mono frameworks. Your PHP code can use any .NET object and library in addition to the standard PHP extensions. The resulting .NET assemblies can be signed and obfuscated. It also provides project templates to allow you to develop PHP applications from within Visual Studio. It is released under the Apache licence.
- Roadsend PHP (Windows and Linux native code)
The Roadsend PHP compiler produces native binaries (executables) for Windows and Linux of your PHP scripts. Your scripts are not restricted to being console (command line) programs: they can be built with an embedded web server, allowing them to work the way they do on a website, albeit on your end-user's system. The compiler is released under the GNU GPL and the runtime under the GNU LGPL. Unfortunately, the program is no longer being actively developed.
- Bambalam (Windows bundle)
This program produces standalone Windows .EXE applications from your PHP source code. It is not actually a native code compiler, since it more or less merely encodes your PHP source and embeds a PHP interpreter, but it's listed on this page because it's probably relevant for people who are looking for native and byte-code compilers. At the time this entry was written, the embedded runtime uses PHP 4.4.4. (The program has not been updated since 2006.) The source code for Bambalam is available.
- Project Zero (Java)
(Update: it looks like this software is now defunct.) Project Zero includes a compiler and runtime that can compile your PHP code into Java bytecode and execute it. With it, you can develop web applications using either PHP or Groovy (another scripting language). It is available for Windows, Mac OS X and Linux. You will need to have the Java Development Kit installed.
Related Pages
- Free Customized Contact Form
- What To Do If You Do Not Own Your Website's Domain Name
- Free PHP Blogging Software (Scripts)
- Free Content Management Systems (CMS) PHP Scripts
- How to Create an Image in PHP
- How to Use PHP Sessions to Store Data
- Is There a WYSIWYG Editor for PHP? Should I Use PHP or HTML for My Website?
- Important Precautions to Take When Buying a Domain Name
Newest Pages
- How to Convert Your Website from XHTML 1.0 to HTML5 the Quick and Easy Way
- How to Set the Height of a DIV Relative to a Browser Window (CSS)
- Free EPUB Readers (Ebook Viewing Software)
- How to Generate the Free Let's Encrypt SSL Certificate on Your Own (Windows) Computer
- How to Insert Meta Tags into a Web Page with BlueGriffon
- How to Play a Song (or Some Other Audio Clip) from a List on a Website
- Two Ways to View a Binary File on Windows Without Installing Anything
- How to Draw a Horizontal Line on a Web Page with Expression Web
- How to Create a Website Free of Charge
- Why Can't I Make Up Any Domain I Want? Is There a Way to Do Away with a Registrar Altogether?
How to Link to This Page
It will appear on your page as:
Free PHP Compilers: native code, .NET and Java bytecode compilers