添付画像サイズ選択機能を可能にするためphp-gdをインストール
March 14, 2017 – 7:33 amWordPressでは、その標準的な機能として、記事(Post)に添付・挿入しようとする画像のサイズを選択する機能がある。
この機能は、添付・挿入しようとする画像をアップロードする際、オリジナル画像を所期の画像サイズに対応する画像ファイルを自動的に加工・生成することにより行われる。これには、phpのモジュールのひとつphp-gdが使用されている。
数か月前、php の最新版 php-7.1.0をインストールしたが、ここでは上述したphp-gd が含まれていなかった。
あらたにphp-gdをyumインストールしたので、インストール時のログをメモしておく:
# yum --enablerepo=remi,epel,remi-php71 install php-gd epel/x86_64/metalink | 5.8 kB 00:00:00 epel | 4.3 kB 00:00:00 remi | 2.9 kB 00:00:00 remi-php71 | 2.9 kB 00:00:00 (1/4): epel/x86_64/updateinfo | 751 kB 00:00:00 (2/4): remi-php71/primary_db | 177 kB 00:00:01 (3/4): remi/primary_db | 1.6 MB 00:00:03 (4/4): epel/x86_64/primary_db | 4.5 MB 00:00:01 Resolving Dependencies --> Running transaction check ---> Package php-gd.x86_64 0:7.1.2-1.el7.remi will be installed --> Processing Dependency: php-common(x86-64) = 7.1.2-1.el7.remi for package: php-gd-7.1.2-1.el7.remi.x86_64 --> Processing Dependency: gd-last(x86-64) >= 2.1.1 for package: php-gd-7.1.2-1.el7.remi.x86_64 --> Processing Dependency: libpng15.so.15()(64bit) for package: php-gd-7.1.2-1.el7.remi.x86_64 --> Processing Dependency: libgd.so.3()(64bit) for package: php-gd-7.1.2-1.el7.remi.x86_64 --> Processing Dependency: libXpm.so.4()(64bit) for package: php-gd-7.1.2-1.el7.remi.x86_64 --> Running transaction check ---> Package gd-last.x86_64 0:2.2.4-1.el7.remi will be installed --> Processing Dependency: libtiff.so.5(LIBTIFF_4.0)(64bit) for package: gd-last-2.2.4-1.el7.remi.x86_64 --> Processing Dependency: libwebp.so.4()(64bit) for package: gd-last-2.2.4-1.el7.remi.x86_64 --> Processing Dependency: libtiff.so.5()(64bit) for package: gd-last-2.2.4-1.el7.remi.x86_64 ---> Package libXpm.x86_64 0:3.5.11-3.el7 will be installed ---> Package libpng.x86_64 2:1.5.13-7.el7_2 will be installed ---> Package php-common.x86_64 0:7.1.0-1.el7.remi will be updated --> Processing Dependency: php-common(x86-64) = 7.1.0-1.el7.remi for package: php-mbstring-7.1.0-1.el7.remi.x86_64 --> Processing Dependency: php-common(x86-64) = 7.1.0-1.el7.remi for package: php-xml-7.1.0-1.el7.remi.x86_64 --> Processing Dependency: php-common(x86-64) = 7.1.0-1.el7.remi for package: php-7.1.0-1.el7.remi.x86_64 --> Processing Dependency: php-common(x86-64) = 7.1.0-1.el7.remi for package: php-pdo-7.1.0-1.el7.remi.x86_64 --> Processing Dependency: php-common(x86-64) = 7.1.0-1.el7.remi for package: php-json-7.1.0-1.el7.remi.x86_64 --> Processing Dependency: php-common(x86-64) = 7.1.0-1.el7.remi for package: php-cli-7.1.0-1.el7.remi.x86_64 ---> Package php-common.x86_64 0:7.1.2-1.el7.remi will be an update --> Running transaction check ---> Package libtiff.x86_64 0:4.0.3-27.el7_3 will be installed --> Processing Dependency: libjbig.so.2.0()(64bit) for package: libtiff-4.0.3-27.el7_3.x86_64 ---> Package libwebp.x86_64 0:0.3.0-3.el7 will be installed ---> Package php.x86_64 0:7.1.0-1.el7.remi will be updated ---> Package php.x86_64 0:7.1.2-1.el7.remi will be an update ---> Package php-cli.x86_64 0:7.1.0-1.el7.remi will be updated ---> Package php-cli.x86_64 0:7.1.2-1.el7.remi will be an update ---> Package php-json.x86_64 0:7.1.0-1.el7.remi will be updated ---> Package php-json.x86_64 0:7.1.2-1.el7.remi will be an update ---> Package php-mbstring.x86_64 0:7.1.0-1.el7.remi will be updated ---> Package php-mbstring.x86_64 0:7.1.2-1.el7.remi will be an update ---> Package php-pdo.x86_64 0:7.1.0-1.el7.remi will be updated --> Processing Dependency: php-pdo(x86-64) = 7.1.0-1.el7.remi for package: php-mysqlnd-7.1.0-1.el7.remi.x86_64 ---> Package php-pdo.x86_64 0:7.1.2-1.el7.remi will be an update ---> Package php-xml.x86_64 0:7.1.0-1.el7.remi will be updated ---> Package php-xml.x86_64 0:7.1.2-1.el7.remi will be an update --> Running transaction check ---> Package jbigkit-libs.x86_64 0:2.0-11.el7 will be installed ---> Package php-mysqlnd.x86_64 0:7.1.0-1.el7.remi will be updated ---> Package php-mysqlnd.x86_64 0:7.1.2-1.el7.remi will be an update --> Finished Dependency Resolution Dependencies Resolved ======================================================================================================================= Package Arch Version Repository Size ======================================================================================================================= Installing: php-gd x86_64 7.1.2-1.el7.remi remi-php71 69 k Installing for dependencies: gd-last x86_64 2.2.4-1.el7.remi remi 131 k jbigkit-libs x86_64 2.0-11.el7 sl 46 k libXpm x86_64 3.5.11-3.el7 sl 53 k libpng x86_64 2:1.5.13-7.el7_2 sl 212 k libtiff x86_64 4.0.3-27.el7_3 sl-security 169 k libwebp x86_64 0.3.0-3.el7 sl 169 k Updating for dependencies: php x86_64 7.1.2-1.el7.remi remi-php71 3.0 M php-cli x86_64 7.1.2-1.el7.remi remi-php71 4.6 M php-common x86_64 7.1.2-1.el7.remi remi-php71 1.0 M php-json x86_64 7.1.2-1.el7.remi remi-php71 55 k php-mbstring x86_64 7.1.2-1.el7.remi remi-php71 572 k php-mysqlnd x86_64 7.1.2-1.el7.remi remi-php71 224 k php-pdo x86_64 7.1.2-1.el7.remi remi-php71 118 k php-xml x86_64 7.1.2-1.el7.remi remi-php71 204 k Transaction Summary ======================================================================================================================= Install 1 Package (+6 Dependent packages) Upgrade ( 8 Dependent packages) Total download size: 11 M Is this ok [y/d/N]: y Downloading packages: Delta RPMs disabled because /usr/bin/applydeltarpm not installed. (1/15): jbigkit-libs-2.0-11.el7.x86_64.rpm | 46 kB 00:00:00 (2/15): libtiff-4.0.3-27.el7_3.x86_64.rpm | 169 kB 00:00:01 (3/15): gd-last-2.2.4-1.el7.remi.x86_64.rpm | 131 kB 00:00:01 (4/15): libpng-1.5.13-7.el7_2.x86_64.rpm | 212 kB 00:00:01 (5/15): libwebp-0.3.0-3.el7.x86_64.rpm | 169 kB 00:00:00 (6/15): php-gd-7.1.2-1.el7.remi.x86_64.rpm | 69 kB 00:00:01 (7/15): libXpm-3.5.11-3.el7.x86_64.rpm | 53 kB 00:00:04 (8/15): php-json-7.1.2-1.el7.remi.x86_64.rpm | 55 kB 00:00:01 (9/15): php-mbstring-7.1.2-1.el7.remi.x86_64.rpm | 572 kB 00:00:02 (10/15): php-mysqlnd-7.1.2-1.el7.remi.x86_64.rpm | 224 kB 00:00:02 (11/15): php-common-7.1.2-1.el7.remi.x86_64.rpm | 1.0 MB 00:00:05 (12/15): php-xml-7.1.2-1.el7.remi.x86_64.rpm | 204 kB 00:00:01 (13/15): php-pdo-7.1.2-1.el7.remi.x86_64.rpm | 118 kB 00:00:02 (14/15): php-7.1.2-1.el7.remi.x86_64.rpm | 3.0 MB 00:00:10 (15/15): php-cli-7.1.2-1.el7.remi.x86_64.rpm | 4.6 MB 00:00:11 ----------------------------------------------------------------------------------------------------------------------- Total 805 kB/s | 11 MB 00:00:13 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : libXpm-3.5.11-3.el7.x86_64 1/23 Installing : 2:libpng-1.5.13-7.el7_2.x86_64 2/23 Updating : php-common-7.1.2-1.el7.remi.x86_64 3/23 Updating : php-json-7.1.2-1.el7.remi.x86_64 4/23 Updating : php-pdo-7.1.2-1.el7.remi.x86_64 5/23 Updating : php-cli-7.1.2-1.el7.remi.x86_64 6/23 Installing : libwebp-0.3.0-3.el7.x86_64 7/23 Installing : jbigkit-libs-2.0-11.el7.x86_64 8/23 Installing : libtiff-4.0.3-27.el7_3.x86_64 9/23 Installing : gd-last-2.2.4-1.el7.remi.x86_64 10/23 Installing : php-gd-7.1.2-1.el7.remi.x86_64 11/23 Updating : php-7.1.2-1.el7.remi.x86_64 12/23 Updating : php-mysqlnd-7.1.2-1.el7.remi.x86_64 13/23 Updating : php-xml-7.1.2-1.el7.remi.x86_64 14/23 Updating : php-mbstring-7.1.2-1.el7.remi.x86_64 15/23 Cleanup : php-7.1.0-1.el7.remi.x86_64 16/23 Cleanup : php-cli-7.1.0-1.el7.remi.x86_64 17/23 Cleanup : php-mbstring-7.1.0-1.el7.remi.x86_64 18/23 Cleanup : php-mysqlnd-7.1.0-1.el7.remi.x86_64 19/23 Cleanup : php-pdo-7.1.0-1.el7.remi.x86_64 20/23 Cleanup : php-xml-7.1.0-1.el7.remi.x86_64 21/23 Cleanup : php-common-7.1.0-1.el7.remi.x86_64 22/23 Cleanup : php-json-7.1.0-1.el7.remi.x86_64 23/23 Verifying : libtiff-4.0.3-27.el7_3.x86_64 1/23 Verifying : 2:libpng-1.5.13-7.el7_2.x86_64 2/23 Verifying : php-json-7.1.2-1.el7.remi.x86_64 3/23 Verifying : php-7.1.2-1.el7.remi.x86_64 4/23 Verifying : php-xml-7.1.2-1.el7.remi.x86_64 5/23 Verifying : php-mysqlnd-7.1.2-1.el7.remi.x86_64 6/23 Verifying : php-pdo-7.1.2-1.el7.remi.x86_64 7/23 Verifying : php-cli-7.1.2-1.el7.remi.x86_64 8/23 Verifying : gd-last-2.2.4-1.el7.remi.x86_64 9/23 Verifying : libXpm-3.5.11-3.el7.x86_64 10/23 Verifying : jbigkit-libs-2.0-11.el7.x86_64 11/23 Verifying : php-mbstring-7.1.2-1.el7.remi.x86_64 12/23 Verifying : php-common-7.1.2-1.el7.remi.x86_64 13/23 Verifying : php-gd-7.1.2-1.el7.remi.x86_64 14/23 Verifying : libwebp-0.3.0-3.el7.x86_64 15/23 Verifying : php-mysqlnd-7.1.0-1.el7.remi.x86_64 16/23 Verifying : php-7.1.0-1.el7.remi.x86_64 17/23 Verifying : php-json-7.1.0-1.el7.remi.x86_64 18/23 Verifying : php-xml-7.1.0-1.el7.remi.x86_64 19/23 Verifying : php-common-7.1.0-1.el7.remi.x86_64 20/23 Verifying : php-mbstring-7.1.0-1.el7.remi.x86_64 21/23 Verifying : php-cli-7.1.0-1.el7.remi.x86_64 22/23 Verifying : php-pdo-7.1.0-1.el7.remi.x86_64 23/23 Installed: php-gd.x86_64 0:7.1.2-1.el7.remi Dependency Installed: gd-last.x86_64 0:2.2.4-1.el7.remi jbigkit-libs.x86_64 0:2.0-11.el7 libXpm.x86_64 0:3.5.11-3.el7 libpng.x86_64 2:1.5.13-7.el7_2 libtiff.x86_64 0:4.0.3-27.el7_3 libwebp.x86_64 0:0.3.0-3.el7 Dependency Updated: php.x86_64 0:7.1.2-1.el7.remi php-cli.x86_64 0:7.1.2-1.el7.remi php-common.x86_64 0:7.1.2-1.el7.remi php-json.x86_64 0:7.1.2-1.el7.remi php-mbstring.x86_64 0:7.1.2-1.el7.remi php-mysqlnd.x86_64 0:7.1.2-1.el7.remi php-pdo.x86_64 0:7.1.2-1.el7.remi php-xml.x86_64 0:7.1.2-1.el7.remi Complete!
php-gdを有効にするためhttpdを再起動
# systemctl restart httpd