LoginSignup
2
1

More than 3 years have passed since last update.

【AWS】WordPress「画像を切り抜く際にエラーが発生しました。」の対処方法

Posted at

現象

Amazon LinuxインスタンスでWordpressをたてた。その際に画像を編集すると「画像を切り抜く際にエラーが発生しました。」とエラーが発生し、画像を切り抜けない。

原因

原因はphp-gdというプログラムがインストールしていないため。
実際にphp-gdがインストールされているか、下記コマンドを入力して確かめたが、やはりインストールされていなかった。

yum info php-gd

表示結果

$ yum info php-gd
読み込んだプラグイン:xxx
利用可能なパッケージ
名前                : php-gd
アーキテクチャー    : xxx
バージョン          : xxx
リリース            : xxx
容量                : xxx
リポジトリー        : xxx
要約                : A module for PHP applications for using the gd graphics
                    : library
URL                 : http://www.php.net/
ライセンス          : PHP and BSD
説明                : The php-gd package contains a dynamic shared object that
                    : will add support for using the gd graphics library to PHP

(一部内容省略)

対処法

1.php-gdを下記コマンドでインストール。

sudo yum -y install php-gd

2.下記コマンドで再起動して有効化。

sudo systemctl restart httpd.service

3.念のため、再起動できているか確認。

sudo systemctl status httpd.service

4.php-gdがインストールされているか確認。

$ yum info php-gd
読み込んだプラグイン:xxx
インストール済みパッケージ
名前                : php-gd
アーキテクチャー    : xxx
バージョン          : xxx
リリース            : xxx
容量                : xxx
リポジトリー        : installed
提供元リポジトリー  : xxx
要約                : A module for PHP applications for using the gd graphics
                    : library
URL                 : http://www.php.net/
ライセンス          : PHP and BSD
説明                : The php-gd package contains a dynamic shared object that
                    : will add support for using the gd graphics library to PHP.

(一部内容省略)

上記作業で、画像を編集する際も「画像を切り抜く際にエラーが発生しました。」というエラーが解消され、画像を切り抜けるようになった。

参考
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/

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1