Thumbnail generation is very important for image-heavy projects. They help to reduce websiteâ€™s outgoing traffic and theyâ€™re one of key factors for websiteâ€™s load time optimisation.
Today, I want to share with you very simple way to achieve thumbnail generation right after image upload.
Before we start, I want to inform you about my serverâ€™sÂ configuration and build. First of all, I prefer using DigitalOcean servers.
OS: Debian PHP: PHP-FPM Dedicated Server with open SSH access
Iâ€™m assuming that, youâ€™re using dedicated or virtual server (not cPanel based), you have SSH access to your server. And your OS is Debian (or one of itâ€™s distros). Also you may or not use framework. But I will provide example based on Yii2 Framework.
Step 1: Install Imagick extension
if you already have this extension then skip this step. In other case install and restart php5-fpm service.
sudoÂ apt-getÂ installÂ php5-imagick service php5-fpm restart