This is the companion code for the tutorial Run your first Temporal Application with PHP.
Before running this application, ensure you have the following installed:
- PHP 8.1 or later with the
ext-grpc
extension. - Composer for managing dependencies.
composer create-project --prefer-dist -sdev temporal/money-transfer-project
cd money-transfer-project
This command will create a new project from the template. All dependencies and necessary files will be installed automatically, including RoadRunner and Temporal.
Clone the repository to your local machine:
git clone https://github.com/temporalio/money-transfer-project-template-php
cd money-transfer-project-template-php
Run the command to install dependencies:
composer install
Start the Temporal Server in development mode:
./temporal server start-dev --log-level error --color always
In another terminal, start RoadRunner:
./rr serve
To execute the money transfer workflow, you can use the provided PHP script. This script will initiate a transfer between two accounts.
php src/transfer.php
To monitor and inspect the progress and status of your money transfer workflows, open the Temporal UI in your browser. This allows you to view running workflows, completed workflows, and detailed execution histories.
Go to http://localhost:8233