Build PHP apps with Microsoft Graph

This tutorial teaches you how to build a PHP console app that uses the Microsoft Graph API.

Tip

If you prefer to just download the completed tutorial, you can download or clone the GitHub repository.

Prerequisites

Before you start this tutorial, you should have PHP and Composer installed on your development machine.

You should also have either a personal Microsoft account with a mailbox on Outlook.com, or a Microsoft work or school account. If you don't have a Microsoft account, there are a couple of options to get a free account:

Note

This tutorial was written with PHP version 8.1.5 and Composer version 2.3.5. The steps in this guide may work with other versions, but that has not been tested.