I made Wordpress on an Amazon Linux instance. When I edit the image at that time, an error occurs saying "An error occurred when cropping the image." And the image cannot be cropped.
The cause is that the program php-gd is not installed. I checked if php-gd was actually installed by entering the following command, but it was not installed either.
yum info php-gd
Display result
$ yum info php-gd
Loaded plugin:xxx
Available packages
name: php-gd
architecture: xxx
version: xxx
release: xxx
capacity: xxx
Repository: xxx
wrap up: A module for PHP applications for using the gd graphics
: library
URL : http://www.php.net/
license: PHP and BSD
Description: The php-gd package contains a dynamic shared object that
: will add support for using the gd graphics library to PHP
(Some contents omitted)
sudo yum -y install php-gd
sudo systemctl restart httpd.service
sudo systemctl status httpd.service
$ yum info php-gd
Loaded plugin:xxx
Installed packages
name: php-gd
architecture: xxx
version: xxx
release: xxx
capacity: xxx
Repository: installed
Source repository: xxx
wrap up: A module for PHP applications for using the gd graphics
: library
URL : http://www.php.net/
license: PHP and BSD
Description: The php-gd package contains a dynamic shared object that
: will add support for using the gd graphics library to PHP.
(Some contents omitted)
With the above work, the error "An error occurred when cropping the image" was resolved when editing the image, and the image can now be cropped.
reference https://webbibouroku.com/Blog/Article/wordpress-php-gd https://www.it-swarm-ja.tech/ja/php/amazon-linux-2%e3%81%aegd%e7%94%bb%e5%83%8f%e6%8b%a1%e5%bc%b5%e3%81%ab%e9%96%a2%e3%81%99%e3%82%8b%e5%95%8f%e9%a1%8c/807484822/
Recommended Posts