This project demonstrates how to implement passwordless authentication via OTP in PHP using Twilio Verify.
To set up the project:
-
Clone it locally
-
Change into the project directory
-
Install the project’s dependencies with Composer
Here is a list of the environment variables that need to be set in .env, along with what they’re for:
Variable |
Format |
Where to find |
|---|---|---|
|
Starts with |
A {twilio-account-sid}[Twilio Account SID] can be found on {twilio-console}[the Twilio Console] dashboard under Account Info. |
|
32-char string. Treat it as a password. |
|
|
32-char string.
Starts with |
The Twilio Console → Verify → Services. Find out more detail {twilio-verify-docs}[in the documentation]. |
Finally, start the application running locally.
composer serveThe application will start on port 8080.
Open http://localhost:8080 in your browser of choice, enter your phone number in the form, in {e164-format}[E.164 format], and submit it.
You’ll be redirected to the OTP verification form, and receive an SMS with a 6-digit OTP code via SMS. Enter the code into the form and submit it.
If the verification was success, you’ll see that confirmed.
Then, if you look in the terminal session or tab where you started the application, you’ll see a log entry similar to the following:
2026/07/16 10:50:00 Verification successfulIf you want to contribute to the project, whether you have found issues with it or just want to improve it, here’s how:
-
Issues: ask questions and submit your feature requests, bug reports, etc
-
Pull requests: send your improvements


