Skip to content
tenzap edited this page Mar 2, 2022 · 15 revisions

We assume this installation using MySQL database.

Get the source code

Download and extract the latest release or tag to your web root folder.

Create database and privileges

You can do it via MySQL console or with MySQL GUI like phpMyAdmin.

If you're using MySQL console, follow the following step.

First, connect to your mysql server (as regular user run):

mysql -u root -p

Create kalkun database:

CREATE DATABASE kalkun;

It's always good idea to create new user and privileges for kalkun database, so other user like root will not get interrupted, it's optional but you're recommended to do this.

GRANT ALL PRIVILEGES ON kalkun.* TO 'username'@'%' IDENTIFIED BY 'password';

IMPORTANT: You should change username and password.

Last, flush users privileges to activate your changes:

FLUSH PRIVILEGES;

Config database

Edit database.php located in kalkun/application/config/, you should see this line:

$db['default']['hostname'] = "localhost";
$db['default']['username'] = "root";
$db['default']['password'] = "password";
$db['default']['database'] = "kalkun";
$db['default']['dbdriver'] = "mysql";

You should set username and password based on your previous step.

Import gammu database schema

Since 0.2.9, Kalkun requires you to setup the gammu database first. See gammu sources, you may find the sql script for that in gammu/docs/sql/mysql.sql of the gammu source package)

Again. you can do the import using MySQL console or MySQL GUI like phpMyAdmin.

If you're using MySQL console (as root user run):

mysql kalkun -u username -p < gammu/docs/sql/mysql.sql

Configure Daemon

The "daemon" task is to manage inbox and autoreply, it's called by php-cli whenever new messages arrive. It's configured on gammu-smsd configuration (smsdrc) at runonreceive directive.

Important: You must configure the "daemon" otherwise you will not get your inbox

For example on Unix (using shell script):

[smsd]
runonreceive = /opt/lampp/htdocs/kalkun/scripts/daemon.sh

Or if you use Windows (using batch file):

[smsd]
runonreceive = C:\xampp\htdocs\kalkun\scripts\daemon.bat

Warning: It always a good idea to move the scripts directory outside the www, so it’s not accessible from browser.

Set correct path on daemon.sh or daemon.bat:

# Configure this (use absolute path)
PHP=/usr/bin/php # php cli path
DAEMON=/path/to/kalkun/scripts/daemon.php # daemon.php path

Make sure that the daemon script is executable.

sudo chmod +x daemon.php daemon.sh daemon.bat

Change URI path in daemon.php, the default value is:

// Please configure this
$url = "http://localhost/kalkun";

Troubleshooting: If somehow gammu-smsd fails to run the daemon script it will throw error like this:

gammu-smsd[3665]: Process failed with exit status 126

Check permission and try to run the script manually.

Launch the installer

Now, you can launch the installer by opening your browser and going to http://url-to-kalkun/. You will be redirected to http://url-to-kalkun/index.php/install and you will see the installation wizard there. The wizard will guide you to complete the installation, it should be easy.

Delete install folder

After installation is complete, you must delete install file otherwise you will be redirected to the installation wizard again. (Note: the installation wizard tries to do this automatically, but may fail due to lack of permission. Then you must delete it manually).

Setup timezone

Before you run kalkun, you should check the timezone of your PHP server is setup correctly. Otherwise your time will be shown incorrectly and your SMS will never be delivered.

Launch it

You are ready to login with default account, username is kalkun and password is kalkun, you should change the password after login for security issue.

Clone this wiki locally