Skip to content
This repository has been archived by the owner on Oct 2, 2022. It is now read-only.

1. Installation

PotcFdk edited this page Aug 1, 2017 · 8 revisions

Installing TemPIC is easy.

First, install the required packages:
A webserver (for example, nginx) and PHP with the following PHP modules:

  • php-bcmath
  • php-zip
  • php-imagick (optional: for thumbnails, required for animated gif thumbnails)
  • php-gd (optional: for thumbnails, alternative to imagemagick without animated gif support)

If you plan to stay up-to-date with TemPIC I recommend installing git as well. For the cleanup script you'll need a command-line interpreter for PHP(7).
If your system separates those into different packages make sure to get the neccessary ones.
(You might see something like a php-cli package available, which is what we need.)

You can easily check this by running php in the shell, php -a typically starts a command line interpreter.
If that's the case then we're doing great!

Next, you might want to create a new user that is going to handle the cleanup job.
adduser tempic
Depending on your setup you might want to add that user to the user group that your webserver
runs in, so the cleanup script can remove user-uploaded files without any permission errors.
That group differs from system to system, I've seen names like www, www-data, apache2 and others,
so make sure you choose the correct one for your configuration.
usermod -aG www-data tempic

Next, login and we should be in an empty home directory at /home/tempic.
Now let's download TemPIC:
git clone https://github.com/PotcFdk/TemPIC
After that, it should be installed in /home/tempic/TemPIC - great!

You should set the correct permissions for the uploads directory, for example:

chown tempic:www-data /home/tempic/TemPIC/web/uploads
chmod 775 /home/tempic/TemPIC/web/upload

The last thing we need to do is add it to the webserver.
How exactly you are going to do that, depends on your setup,
you basically need to make the /home/tempic/TemPIC/web available to the webserver.
Here is how the reference system, running nginx with php-fpm, was deployed:
ln -s /home/tempic/TemPIC /var/www/tempic
Then a subdomain was configured in /etc/nginx/sites-available/tempic:

server {
        listen 80;
        server_name tempic.example.com;
        index index.php index.htm index.html;
        client_max_body_size 20M;
        root /var/www/tempic/;
        location ~ \.php$ {
            try_files $uri =404;
            fastcgi_pass   unix:/var/run/php7.0-fpm.sock;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PHP_VALUE "upload_max_filesize=20M \n post_max_size=20M";
            include        fastcgi_params;
        }
}

After that, TemPIC should be available at tempic.example.com!

Clone this wiki locally