phalanger php compiler,“Hello world” in Phalanger PHP compiler

问题

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.

echo "Hello World from Phalanger!";

回答1:

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.

来源:https://stackoverflow.com/questions/18849763/hello-world-in-phalanger-php-compiler

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值