Setup and dependency installations
(Windows)
Ensure that you have PHP version 5 and above to run this demo.
STEP 1: We will use WAMPserver for windows. You can download the .msi files here. Double click on the downloaded file and just follow the instructions. The WampServer package is delivered with the latest releases of Apache, MySQL and PHP.
Also enable the php5-curl plugin for the application to successfully interact with Africa's Talking APIs. You should also install Composer to manage PHP dependencies including the Africa's Talking Gateway.
STEP 2: The “www” directory will be automatically created (usually c:\wamp\www). Create a subdirectory in “www” and put your PHP files inside. Within c:\wamp\www
>md projectName
projectName> composer require africastalking/africastalking
Your files are now served from the URL : http://localhost/projectName/*.php
With your environment set up, you are now ready to start writing your application.
(Linux - *unix variants / mac)
Ensure that you have PHP version 5 and above to run this demo. You should also install php5-curl as well as Composer to interact with the Africa's Talking Gateway.
You can easily do this from your terminal - install LAMP, PHP5-curl and Composer. We assume a debian/ubuntu linux environment. You can follow this guide to install LAMP.
STEP 1: Install LAMP, php5-curl
From the command-line, type the following:
$ sudo apt update && sudo apt install apache2 &&\
sudo apt install mysql-server libapache2-mod-auth-mysql php5-mysql &&\
sudo apt install php5 libapache2-mod-php5 php5-mcrypt php5-curl
STEP 2: Install Composer
Download composer.phar in your project folder and run:
$ php composer.phar
STEP 2: Create a project folder in the webroot at /var/www/html
$cd /var/www/html
var/www/html$ mkdir projectName
projectName$ composer require africastalking/africastalking
Your files are now served from the URL : http://localhost/projectName/*.php
With your environment set up, you are now ready to start writing your application.