Server Requirements

SoftwareRecommendedMinimumMore Information
(fastcgi, curl, bcmath, mbstring, mysqli, PDO, pdo_mysql, zip)
(Innodb support)

*You must have installed at least one out of the two web servers.

Rewrite Rules

Before installing tinyCampaign, make sure the rewrite rules exist. Not all server setups are the same, so the Apache rewrite rules may need adjusting.


RewriteEngine On

# Some hosts may require you to use the `RewriteBase` directive.
# If you need to use the `RewriteBase` directive, it should be the
# absolute physical path to the directory that contains this htaccess file.
# RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]

Nginx (root directory)

location / {
    try_files $uri /index.php$is_args$args;

Nginx (subdirectory)

location /newsletter {
    try_files $uri /newsletter/index.php$is_args$args;

Create a Database

Before starting with the installation, you must first create a database. When creating the database, make sure that it has the following collation/charset: utf8mb4_unicode_ci

Install tinyCampaign

Now that you’ve uploaded the files to your server, you need to log into your server via ssh and navigate to the root of tinyCampaign (tinyC). After creating an ssh session, follow the instructions below.

Note: Windows users will need to install Cygwin to give them Linux type functionality via the command line.

  • chmod +x phinx (this is the file *without* the .php extension)
  • make a copy of phinx.sample.php and rename the copy to phinx.php. Open phinx.php and edit the database details. You must create the database first. tinyC will not create the database for you. Your phinx.php file should look similar to below once you’ve edited it:
defined('DB_HOST') or define('DB_HOST', ''); // Usually localhost or
defined('DB_NAME') or define('DB_NAME', ''); // Database name.
defined('DB_USER') or define('DB_USER', ''); // Database username.
defined('DB_PASS') or define('DB_PASS', ''); // Database password.
defined('DB_PORT') or define('DB_PORT', 3306); // Database port.

After entering your database details, run the following command to start the install and database migration:

$ ./phinx migrate -e production

Once the installation is complete, you should see a message similar to below:

Phinx by Rob Morgan - version 0.6.4

using config file ./phinx.php
using config parser php
using migration path app/migrations
using environment production
using adapter mysql
using database phinx

 == 20160916002812 InitialSchema: migrating
 == 20160916002812 InitialSchema: migrated 9.5899s

All Done. Took 9.9171s

Once installed, you can login as the super administrator with the login details below. If your installation is a accessible via the web, please make sure to update the login details with something more secure. You can change your username via PHPMyAdmin, or you can use the Username Changer plugin which comes with the program.

  • Username: tinyc
  • Password: tinycampaign

Cookies and File Savepath

After the initial migration, a config.php file should now exist in the root of your installation. You should open it and edit the following:

$app = new \Liten\Liten(
    'cookies.lifetime' => '86400',
    'cookies.savepath' => ini_get('session.save_path') . DS . $subdomain . DS,
    'file.savepath' => ini_get('session.save_path') . DS . $subdomain . DS . 'files' . DS

The default session.save_path on most servers is /tmp/. However, if you restart your server, anything in the /tmp/ directory will be deleted. So, you should change the path of where important files should be saved. Please note, that these files must not be saved in the public directory.

As an example, if your installation is installed at /home/username/public_html/tinyc/, you will need to create a directory with the correct write permissions above the public directory (i.e. /home/username/tinyc_tmp). Now that we have our new folder (tinyc_tmp) created above the root and out of prying eyes, our new instantiated $app object will now look similar to below:

$app = new \Liten\Liten(
    'cookies.lifetime' => '86400',
    'cookies.savepath' => '/home/username/tinyc_tmp' . DS . $subdomain . DS,
    'file.savepath' => '/home/username/tinyc_tmp' . DS . $subdomain . DS . 'files' . DS

Now we are done, and tinyC is ready for use.

If you are having issues with your new installation, check out Debugging tinyCampaign.

Updated on August 14, 2017

Was this article helpful?

Related Articles