[AWS] How to deal with WordPress "An error occurred when cropping an image."

phenomenon

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.

Cause

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)

approach

  1. Install php-gd with the following command.
sudo yum -y install php-gd
  1. Reboot with the following command to enable it.
sudo systemctl restart httpd.service
  1. Just in case, check if it can be restarted.
sudo systemctl status httpd.service
  1. Make sure php-gd is installed.
$ 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

[AWS] How to deal with WordPress "An error occurred when cropping an image."
How to deal with UnicodeDecodeError when executing google image download
How to deal with errors when hitting pip ②
How to deal with OAuth2 error when using Google APIs from Python
How to crop an image with Python + OpenCV
How to deal with SSL error when connecting to S3 with boto of Python
Post an article with an image to WordPress with Python
[AWS] Wordpress How to deal with "The response is not a correct JSON response"
How to deal with "Type Error: No matching signature found" error when using pandas fillna
[Linux] How to deal with garbled characters when viewing files
What to do when an error occurs with import _ssl
How to deal with imbalanced data
How to deal with imbalanced data
How to deal with DistributionNotFound errors
How to deal with python installation error in pyenv (BUILD FAILED)
[Beanstalk] What to do when an error occurs with import uuid
How to deal with errors when installing Python and pip with choco
How to deal with the error "Failed to load module" canberra-gtk-module "that appears when you run OpenCV
When I get an error with PyInstaller
How to deal with enum compatibility errors
[Python] How to deal with module errors
Try to generate an image with aliasing
What to do if an error occurs when importing numpy with VScode
How to deal with memory leaks in matplotlib.pyplot
I got an error when saving with OpenCV
Workaround if you get an error when trying to install PySide with pip
can't pickle annoy. How to deal with Annoy objects
An error occurs when trying to import scikit-learn after connecting to Oracle with SQLAlchemy
How to deal with run-time errors in subprocess.call
How to deal with module'tensorflow' has no attribute'〇〇'
How to deal with "No module named'〇〇'" error in Jupyter Notebook | Install with! Pip!
How to read an array with Python's ConfigParser
How to display in the entire window when setting the background image with tkinter
What to do if you get an error when installing python with pyenv
Rollback processing when an error occurs with fabric
What to do if you get an OpenSSL error when installing Python 2 with pyenv
How to make an arbitrary DictCursor with PyMySQL and not return None when NULL
What to do if you get an Import Error when importing matplotlib with Jupyter
I want to convert an image to WebP with lollipop
How to make AWS rekognition recognize local image files
How to scrape image data from flickr with python
How to deal with Django's Template Does Not Exist
How to deal with pyenv initialization failure in fish 3.1.0
How to access with cache when reading_json in pandas
How to make an HTTPS server with Go / Gin
An error related to saas occurred during bundle install
How to create an image uploader in Bottle (Python)
I got an error when using Tensorboard with Pytorch
How to deal with Executing transaction: failed in Anaconda
How to deal with "fatal: destination path''already exists and is not an empty directory." When trying to clone on Git hub
Addresses an issue where an error does not occur even if the path does not pass when trying to read an image with cv2.imread ()
How to deal with the error that Docker's MySQL container fails to start on Docker Toolbox
How to deal with the terminal getting into the pipenv environment without permission when using pipenv with vscode
What to do if you get an Undefined error when trying to use pip with pyenv
How to convert an array to a dictionary with Python [Application]
How to not load images when using PhantomJS with Selenium
[Ev3dev] How to display bmp image on LCD with python
After installing CentOS8 with VirtualBox, an error occurs when restarting
How to manipulate the DOM in an iframe with Selenium
How to resolve CSRF Protection when using AngularJS with Django
How to run an app built with Python + py2app built with Anaconda