Skip to content

Instantly share code, notes, and snippets.

@beppe9000
Last active March 20, 2020 23:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beppe9000/f73b16c3b13841047583b6340f2e4ebb to your computer and use it in GitHub Desktop.
Save beppe9000/f73b16c3b13841047583b6340f2e4ebb to your computer and use it in GitHub Desktop.
Minimum Complete usage of compiling a PHP script with Peachpie.NET
Run the `START.BAT`file to compile the php script and run the resulting exe.
This is the final example from https://github.com/peachpiecompiler/peachpie/issues/708
<?php
echo "\nHELLO FROM PHP !!!\n\n";
<Project Sdk="Peachpie.NET.Sdk/0.9.920">
<PropertyGroup>
<OutputType>exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<StartupObject>program.php</StartupObject>
</PropertyGroup>
<ItemGroup>
<Compile Include="**/*.php" />
</ItemGroup>
</Project>
dotnet publish -c release
if exist .\bin\release\netcoreapp3.0\project.exe (
REM Run the exe if it is there...
.\bin\release\netcoreapp3.0\project.exe
)
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment