Welcome to the PHP Starter!
This project is pre-configured with some useful Twilio functionality using the Twilio helper library for PHP.
Setting Up
If you're in need of a PHP development environment, the quickest way to get one set up is to use MAMP on OS X or XAMPP on Windows (or Linux). Follow the instructions on their respective websites to download and install their software.
Once you have a local PHP stack you are happy with, either dump the contents of this project's www
directory into your server's web root, or configure your Apache server to serve files out of the www
directory as the web root. Using MAMP, this looks like this:
...and then this...
Then, start your servers by clicking the "Start Servers" button - on MAMP it looks like this after starting:
Now, navigate to the www
folder of this project. Rename config.php.sample
to config.php
. Open this file and locate the following three lines of configuration:
<?php
$TWILIO_ACCOUNT_SID = 'CHANGE_ME';
$TWILIO_AUTH_TOKEN = 'CHANGE_ME';
$TWILIO_NUMBER = 'CHANGE_ME';
These values inside quotes will need to be replaced with the following information from your Twilio account:
TWILIO_ACCOUNT_SID
: Your Twilio "account SID" - it's like your username for the Twilio API. This and the auth token (below) can be found on your account dashboard.TWILIO_AUTH_TOKEN
: Your Twilio "auth token" - it's your password for the Twilio API. This and the account SID (above) can be found on your account dashboard.TWILIO_NUMBER
: A Twilio number that you own, that can be used for making calls and sending messages. You can find a list of phone numbers you control (and buy another one, if necessary) in the account portal.
Now your project should be all set!
Running the Application
If you successfully started your MAMP or XAMPP server, it is likely to be running locally on port 8080. Navigate to this page, and you should find a UI.
Try out the voice and messaging demos by entering your mobile phone number and pressing the button. If you receive a voice call and a text message from your Twilio number, you're all set!
Begin Learning Twilio!
This is your first step in the Twilio learning program. Return to the site to continue on. Huzzah!