Tideways Installation

Foreword

If you would like to use Tideways, a very comprehensive PHP profiler, on your website and/or online store, our installation guide will show you how to install and configure the service on your server.


Prerequisites

  • Managed server
  • active Tideways license



Installation

To install Tideways on Debian and Ubuntu servers, you need an active root SSH connection to start the installation.


First of all, the Tideways PHP Service and the Tideways Daemon must be installed. Both packages are installed using the following SSH commands:


echo 'deb https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list


wget -qO - https://packages.tideways.com/key.gpg | apt-key add -


 apt-get update && apt-get install tideways-php tideways-daemon


After installation, Tideways must be configured with your API key and the desired environment (production, stage, etc.). The next steps for Plesk, PHP-FPM and Mod PHP (Apache2) will show you how to configure Tideways successfully.


Configuration under Plesk

To configure Tideways under Plesk, log in to your Plesk Control Panel and navigate to Website → PHP Settings → Additional Instructions



You can find your Tideways API key under Tideways → Project → Setup → php.ini

The structure is as follows:


Apache

SetEnv TIDEWAYS_APIKEY XXXXXXXXXXXXXXXXXXX
SetEnv TIDEWAYS_SAMPLERATE 25


NGINX

location / {
    ...
    fastcgi_param TIDEWAYS_APIKEY 0dhA0nWXp6HI4Tpm;
    fastcgi_param TIDEWAYS_SAMPLERATE 25;
        ...
}


Insert this into the additional configuration statement in Plesk so that the result looks like this:



After the installation you can check if Tideways is already collecting data, please wait 60 seconds so that Tideways can collect the data.



Configuration under PHP-FPM


To configure Tideways under PHP-FPM, you need an active SSH connection with which you can log on to the desired server.


Once you are connected, open the zz-creoline.ini with nano or vim and edit the file as specified.


Please note that the instructions in zz-creoline.ini should not be changed, only add the API key from Tideways here.


nano /etc/php/8.2/fpm/conf.d/zz-creoline.ini


The file should look something like this example file:

; Copyright (C) 2023 creoline GmbH
; PHP.ini Configuration for PHP 8.2
; Version: 1.6

max_execution_time=120
memory_limit=1024M
upload_max_filesize=10G
post_max_size=10G

; OpCache Config
; opcache (memory consumption unit: MB)
opcache.memory_consumption=2048
opcache.max_accelerated_files=100000

opcache.jit_buffer_size=100M
opcache.jit=1255

session
; session.save_handler = redis
; session.save_path = tcp://10.20.2.1:6379

; tideways
; tideways.api_key=
; tideways.sample_rate=25

; Shopware 6
assert.active=0
opcache.enable_file_override=1
opcache.interned_strings_buffer=50
zend.detect_unicode=0
realpath_cache_ttl=3600

\You must add the following lines to zz-creoline.ini:

tideways.api_key=XXXXXXXXXXXXXXXXXXXXXXXX
tideways.sample_rate=25


After configuration, you should reload the PHP-FPM service by executing the following commands:

# Configtest
php-fpm8.2 --test

# Reload
systemctl reload php8.2-fpm.service



Configuration under Mod PHP (Apache2)


If you install Tideways under Apache2, log in as root user via SSH on your server for which you want to analyze the data with Tideways.


First of all you have to store the API key of Tideways, use the zz-creoline.ini, if the file does not yet exist, you can create it with the following command:

nano /etc/php/8.2/fpm/conf.d/zz-creoline.ini


You must add the following lines to zz-creoline.ini:

tideways.api_key=XXXXXXXXXXXXXXXXXXXXXX
tideways.sample_rate=25


After the configuration, you should reload the PHP-FPM service by executing the following commands:

# Configtest
php-fpm8.2 --test

# Reload
systemctl reload php8.2-fpm.service



Set environment


In Tideways you can display several environments, the configuration is done via the supplied tideways-daemon file.



The file can be found under /etc/default/tideways-daemon and can be edited with nano or vim. To edit the file, the following command can be used:


nano /etc/default/tideways-daemon


The file content should look like this, for example:

TIDEWAYS_DAEMON_EXTRA="--env=staging"


If you want to display your staging environment, use --env=staging, if you use Tideways on your production environment, you must enter --env=production here.


The data will be displayed in the specified environment after a restart.