1

Install .NET Core SDK

.NET Core builds and empowers your application. It is a universal, cross-platform and secure environment for your code.

2

Install Peachpie .NET Templates

We have prepared common project types for you to get started. They hide all the complexity of project files and come with code samples.

dotnet new -i Peachpie.Templates::*

3

Create Website

Now create the project. The command creates all the files required by the initial solution. Website directory will contain the root of your PHP web site.

Continue by editing the newly created Website/index.php file.

dotnet new peachpie-web -lang PHP

4

Run Your Project

Navigate to the Server directory. This is the entry point of the web application, working as a bootstrapper for your PHP website.

The commands restore all dependencies, compile the project and start the web server.

cd Server
dotnet restore
dotnet run

Test Your WebSite

Open your favorite web browser and enter the URL.

http://localhost:5004

1

Install .NET Core SDK

.NET Core builds and empowers your application. It is a universal, cross-platform and secure environment for your code.

2

Install Peachpie .NET Templates

We have prepared common project types for you to get started. They hide all the complexity of project files and come with code samples.

dotnet new -i Peachpie.Templates::*

3

Create Some Code

The following command creates the project and a sample script .php file.

dotnet new peachpie-console -lang PHP

4

Run Your Program

Restore packages, compile your code and run with the following commands.

dotnet restore
dotnet run

That’s It

You’ve just created a .NET executable program in PHP! Discover other possibilities and use cases with PHP on .NET, or migrate an existing PHP library to the .NET platform.