Image rotation and editing stopped working in Wordpress after upgrading Ubuntu from 16.04 to 18.04

I'm seeing this error in Wordpress Media editor:

"Image rotation is not supported by your web host."

I checked on my server and I have php7-gd:

php -i | grep -i gd
/etc/php/7.2/cli/conf.d/20-gd.ini,
gd
GD Support = enabled
GD headers Version = 2.2.5
GD library Version = 2.2.5
gd.jpeg_ignore_warning = 1 = 1

Does anyone know what could be a problem here?

Topic php linux media Wordpress

Category Web


GD uses the function imagerotate. According to this answer on stackoverflow the function isn't included on some OS'es because of a memory leak. This problem is also mentioned as comment in the WordPress code:

On some setups GD library does not provide imagerotate() - Ticket #11536

The ticket number belongs to the WordPress Ticket #11536.

As a solution you can try to use the workaround mentioned in the stackoverflow answer or you can install php-imagick as an alternative to gd, which is also supported by WordPress.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.