This repo holds an example PHP application that uses FusionAuth as the identity provider.
This repository is documented at https://fusionauth.io/docs/quickstarts/quickstart-php-web.
Further reading:
The docker-compose.yml file and the kickstart directory are used to start and configure a local FusionAuth server.
The complete-application directory contains a fully working version of the application.
To run FusionAuth, just stand up the docker containers using docker-compose.
First clone the example repo and change into the project directory:
git clone https://github.com/FusionAuth/fusionauth-quickstart-php-web.git
cd fusionauth-quickstart-php-web/complete-application
composer installStart the containers with docker compose.
docker compose upThis will start a PostgreSQL, Opensearch and FusionAuth container.
FusionAuth will initially be configured with these settings:
- Your client id is:
e9fdb985-9173-4e01-9d73-ac2d60d1dc8e - Your client secret is:
super-secret-secret-that-should-be-regenerated-for-production - Your example username is
[email protected]and your password ispassword. - Your admin username is
[email protected]and your password ispassword. - Your fusionAuthBaseUrl is 'http://localhost:9011/'
You can log into the FusionAuth admin UI and look around if you want, but with Docker/Kickstart you don't need to.
Change into the complete application directory and run the following commands.
cd complete-application
composer installStart up the application server with the following
php -S localhost:9012 -t publicBrowse to the app at http://localhost:9012 and login with [email protected] and password.
Follow the tutorial at https://fusionauth.io/docs/quickstarts/quickstart-php-web to learn how to configure PHP to work with FusionAuth.