I have two dev environment setup
- Test - PHP Version 7.0.33-1+ubuntu16.04.1+deb.sury.org+1 + GD headers Version 2.2.5 (as per phpinfo)
- Production - PHP Version 7.0.32-0ubuntu0.16.04.1 + GD headers Version 2.1.1 (as per phpinfo)
on Amazon EC2 Ubuntu in which i am trying to use image resizing with codeigniter image manipulation class with this code.
$resizeConfig['image_library'] = 'gd2';
$resizeConfig['source_image'] = $imageName;
$resizeConfig['new_image'] = $imageName;
$resizeConfig['width'] = 320;
$resizeConfig['height'] = 215;
$resizeConfig['maintain_ratio'] = FALSE;
$resizeConfig['quality'] = '100%';
$this->load->library('image_lib');
$this->image_lib->initialize($resizeConfig);
both the servers are showing GD
installed and enabled if i check on PHPINFO()
The problem is TEST Environment works fine with the code and resizing images on the fly. However, PROD server not working with image resizing with the same code. Install GD
on PROD
with this command
sudo apt-get install php7.0-gd
Please help me out what i am missing over here. Any help is appreciated. TIA.