问题描述
我希望仅使用Phalanger运行我的控制台程序。我没有以任何方式使用IIS或.net。是否可以以与使用 php.exe -f hello.php
相同的方式使用Phalanger?如何使用Phalanger编译和运行以下脚本。
I want my console program simply be run using Phalanger. I did not use IIS or .net in any way. Is it possible to use Phalanger in the same way that we use php.exe -f hello.php
? How to compile and run following script using Phalanger.
<?php
echo "Hello World from Phalanger!";
推荐答案
Phalanger是PHP的编译器和运行时。
Phalanger works as a compiler and runtime for PHP.
最简单的方法是安装用于Visual Studio的Phalanger工具,该工具可用于创建,构建和调试控制台应用程序。
The easiest way is to install Phalanger Tools for Visual Studio, which allows you to create, build and debug console application.
无论如何,都没有Visual Studio;首先,您必须编译代码
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
哪个会编译当前目录中的所有内容(* .php)和子目录,并指定 hello.php
作为输入脚本文件。
Which compiles everything (*.php) in current directory and subdirectories, and specifies "hello.php
" to be the entering script file.
这将创建一个可执行文件 hello.exe
。
This creates an executable file "hello.exe
".
在成功完成此基本示例之后,您可能会对使用某些PHP感兴趣扩展名(如GD2)。这可以通过添加以下参数
/ r:PhpNetGd2,Version = 3.0.0.0,Culture = neutral,PublicKeyToken = 2771987119c16a03
来完成。包含GD2功能的库。
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.
这篇关于“ Hello world”在Phalanger PHP编译器中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!