“Hello world” in Phalanger PHP compiler

牧云@^-^@ 提交于 2019-12-06 09:40:51
Jakub Míšek

Phalanger works as a compiler and runtime for PHP.

The easiest way is to install Phalanger Tools for Visual Studio, which allows you to create, build and debug console application.

Anyway, without Visual Studio; first you have to compile the code

phpc  hello.php /out:hello.exe

Optionally, if you have more files in your project, you should list them all, and specify the entering script file

phpc.exe /target.exe /entrypoint:hello.php /root:. /recurse:true /out:hello.exe

Which compiles everything (*.php) in current directory and subdirectories, and specifies "hello.php" to be the entering script file.

This creates an executable file "hello.exe".

After you succeed with this basic example, you may be interested in using some PHP extensions (like GD2). This can be done by adding following parameter, "/r:PhpNetGd2, Version=3.0.0.0, Culture=neutral, PublicKeyToken=2771987119c16a03 which is the full name of the library containing GD2 functionality.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!