Dapr PHP SDK
Dapr offers an SDK to help with the development of PHP applications. Using it, you can create PHP clients, servers, and virtual actors with Dapr.
Optional Prerequisites
- xdebug – for debugging
Initialize your project
Create a config.php, copying the contents below:
Create your service
<?php
use Dapr\App;
$app = App::create(configure: fn(\DI\ContainerBuilder $builder) => $builder->addDefinitions(__DIR__ . '/config.php'));
return ['hello' => $name];
});
$app->start();
Initialize dapr with dapr init
and then start the project with .
Congratulations, you’ve created your first Dapr service! I’m excited to see what you’ll do with it!