[英]GD image resize not working on production server (Amazon EC2 Ubuntu)
I have two dev environment setup 我有两个开发环境设置
on Amazon EC2 Ubuntu in which i am trying to use image resizing with codeigniter image manipulation class with this code. 在Amazon EC2 Ubuntu上,我试图在此代码中使用带有codeigniter图像处理类的图像大小调整 。
$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()
如果我检查
PHPINFO()
两个服务器都显示GD
已安装并启用
The problem is TEST Environment works fine with the code and resizing images on the fly. 问题在于, TEST Environment可以很好地与代码配合使用并实时调整图像大小。 However, PROD server not working with image resizing with the same code.
但是, PROD服务器无法使用相同的代码调整图像大小。 Install
GD
on PROD
with this command 使用此命令在
PROD
上安装GD
sudo apt-get install php7.0-gd
Please help me out what i am missing over here. 请帮助我,我在这里想念的东西。 Any help is appreciated.
任何帮助表示赞赏。 TIA.
TIA。
The code was not enough for production server. 该代码不足以用于生产服务器。 since i am working with codeigniter.
由于我正在与Codeigniter合作。 I had to add following line.
我必须添加以下行。
$this->image_lib->resize();
after 后
$this->image_lib->initialize($resizeConfig);
But i still wonder how the same code was working with testing server without that additional line. 但是我仍然想知道相同的代码如何在没有其他行的情况下与测试服务器一起工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.