-1

I've followed this tutorial to install and support PHP-5.6 at my ISPConfig3 server: https://www.howtoforge.com/tutorial/how-to-install-php-5-6-on-ubuntu-16-04/.

The installation is up and running, now I want to change the php-gd library version. PHP info actually reports:

GD Support  enabled

GD Version  bundled (2.1.0 compatible)

I need to use the following version:

GD Support  enabled

GD headers Version  2.2.3

GD library Version  2.2.3

Why do i need to upgrade?

I'm facing problems when cropping images, but is only on this server. I've a similar server with PHP-5.6, without fpm, that is working fine. I realized the difference in versions after compare the phpinfo() reports from both servers

Expected Behavior

  1. User uploads an image. The image can have any dimension. (eg: 1920x1080)
  2. The script resizes the image. (eg: from 1920px to 1200px)
  3. The resized image maintain it's original aspect ratio and should not be cropped. See: https://i.stack.imgur.com/YW8N4.jpg

The problem

  1. User uploads an image. The image can have any dimension. (eg: 1920x1080)
  2. The script SHOULD resize the image. (eg: from 1920px to 120px)
  3. The final image was cropped erroneously :( See: https://i.stack.imgur.com/aKwxQ.jpg

Since i'm using php-fpm, how can i upgrade my GD library version?

Ricardo Vigatti
  • 526
  • 13
  • 29
  • It's generally best to stick to the supported version from your package manager. Is there something in 2.2 you absolutely must have? – ceejayoz Aug 07 '17 at 19:33
  • I'm facing problems when cropping images, but is only on this server. I've a similar server with PHP-5.6, without fpm, that is working fine. I realized the difference in versions after compare the phpinfo() reports from both servers. – Ricardo Vigatti Aug 07 '17 at 19:39
  • Could you share the problems? We might be able to assist with those. – ceejayoz Aug 07 '17 at 20:13
  • I'll update the question, providing the actual and expected behaviors... – Ricardo Vigatti Aug 07 '17 at 20:24
  • updated, added links to images. Plz tell me if it is not clear yet – Ricardo Vigatti Aug 07 '17 at 20:38
  • Switch to ondrej ppa: https://launchpad.net/~ondrej/+archive/ubuntu/php It has GD 2.2.3 – Matt Aug 07 '17 at 20:40
  • @RicardoVigatti Can you share the code being used to generate these? – ceejayoz Aug 07 '17 at 20:49
  • @mkaatman ondrej's php version is great, actually, i have it installed, but i don't know how to make it work with php-fpm in my ISPConfig server. – Ricardo Vigatti Aug 07 '17 at 22:26
  • @ceejayoz, it's kind of hard to share the code cause it's a legacy system. The point here is that it's working in another simillar installation, remember? Anyway, i'll search for some code blocks that may help – Ricardo Vigatti Aug 07 '17 at 22:33
  • Hi guys, thanks for your comments until now. So, i was able to build ondrej's version of php-5.6 with the correct gd version. Well, the problem still happening. Now i have no hope, I can't imagine why the resizing isn't working as expected. The only difference in servers, reported by phpinfo, is the Server API option. Working server has Server API Apache 2.0 Handler while the other is using FPM/FastCGI. – Ricardo Vigatti Aug 08 '17 at 13:14
  • If you run phpinfo(); does it show you the correct version of GD? You should probably post a new question with a [mcve] so we can troubleshoot. – Matt Aug 08 '17 at 13:33
  • @mkaatman thank you for your reply. I'll need to dig further into this issue before i can post a new question. The problem didn't seems to be what i was thinking. – Ricardo Vigatti Aug 08 '17 at 14:02

1 Answers1

0

After long hours digging, I finally found the problem, and as i expected, it's not related to GD library itself. It's related to phpThumb and imagemagick libraries.

Ricardo Vigatti
  • 526
  • 13
  • 29