LoginSignup
7
8

More than 5 years have passed since last update.

PHP7のExtension installの方法

Last updated at Posted at 2016-11-16

WordPressをPHP7で動かす際に、Extensionが必要な場合もあるが、中々動かなかったため調べた結果、そもそものパッケージ名が違うと言うことがわかったので、ここに記す。

パッケージ名の調べ方

$ yum --enablerepo=epel,remi,remi-php70 search php70
remi                                                     | 2.9 kB     00:00     
remi-php70                                               | 2.9 kB     00:00     
(1/2): remi-php70/primary_db                               | 161 kB   00:00     
(2/2): remi/primary_db                                     | 1.5 MB   00:01     
Determining fastest mirrors
 * base: ftp.iij.ad.jp
 * epel: s3-mirror-ap-northeast-1.fedoraproject.org
 * extras: ftp.iij.ad.jp
 * remi: mirrors.mediatemple.net
 * remi-php70: mirrors.mediatemple.net
 * remi-safe: mirrors.mediatemple.net
 * updates: ftp.iij.ad.jp
============================== N/S matched: php70 ==============================
php70-php-pecl-propro-devel.x86_64 : php70-php-pecl-propro developer files
                                   : (header)
php70-php-pecl-raphf-devel.x86_64 : php70-php-pecl-raphf developer files
                                  : (header)
php70-php-pecl-xmldiff-devel.x86_64 : php70-php-pecl-xmldiff developer files
                                    : (header)
php70-php-pecl-yaconf-devel.x86_64 : php70-php-pecl-yaconf developer files
                                   : (header)
php70-php-yaconf-devel.x86_64 : php70-php-yaconf developer files (header)
php70-runtime.x86_64 : Package that handles php70 Software Collection.
php70-scldevel.x86_64 : Package shipping development files for php70
php70.x86_64 : Package that installs PHP 7.0
php70-build.x86_64 : Package shipping basic build configuration
php70-php.x86_64 : PHP scripting language for creating dynamic web sites
php70-php-ast.x86_64 : Abstract Syntax Tree
php70-php-bcmath.x86_64 : A module for PHP applications for using the bcmath
                        : library

〜

このように、一覧が出てきます。

パッケージの入れ方 php-xmlの場合

wordpressのプラグインAmazonJSはsimplexmlが必要なので、php-xmlを入れる必要があります。

$ sudo yum --enablerepo=epel,remi,remi-php70 install php70-php-xml.x86_64
読み込んだプラグイン:fastestmirror
remi                                                     | 2.9 kB     00:00     
remi-php70                                               | 2.9 kB     00:00     
(1/2): remi-php70/primary_db                               | 161 kB   00:00     
(2/2): remi/primary_db                                     | 1.5 MB   00:01     
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * epel: s3-mirror-ap-northeast-1.fedoraproject.org
 * extras: ftp.iij.ad.jp
 * remi: mirror.innosol.asia
 * remi-php70: mirror.innosol.asia
 * remi-safe: mirror.innosol.asia
 * updates: ftp.iij.ad.jp
依存性の解決をしています
--> トランザクションの確認を実行しています。
---> パッケージ php70-php-xml.x86_64 0:7.0.13-1.el7.remi を インストール
--> 依存性の処理をしています: php70-php-common(x86-64) = 7.0.13-1.el7.remi のパッケージ: php70-php-xml-7.0.13-1.el7.remi.x86_64
--> トランザクションの確認を実行しています。
---> パッケージ php70-php-common.x86_64 0:7.0.13-1.el7.remi を インストール
--> 依存性の処理をしています: php70-php-json(x86-64) = 7.0.13-1.el7.remi のパッケージ: php70-php-common-7.0.13-1.el7.remi.x86_64
--> 依存性の処理をしています: php70-runtime のパッケージ: php70-php-common-7.0.13-1.el7.remi.x86_64
--> トランザクションの確認を実行しています。
---> パッケージ php70-php-json.x86_64 0:7.0.13-1.el7.remi を インストール
---> パッケージ php70-runtime.x86_64 0:1.0-5.el7.remi を インストール
--> 依存性の処理をしています: scl-utils のパッケージ: php70-runtime-1.0-5.el7.remi.x86_64
--> 依存性の処理をしています: environment-modules のパッケージ: php70-runtime-1.0-5.el7.remi.x86_64
--> トランザクションの確認を実行しています。
---> パッケージ environment-modules.x86_64 0:3.2.10-10.el7 を インストール
--> 依存性の処理をしています: libtcl8.5.so()(64bit) のパッケージ: environment-modules-3.2.10-10.el7.x86_64
---> パッケージ scl-utils.x86_64 0:20130529-17.el7_1 を インストール
--> トランザクションの確認を実行しています。
---> パッケージ tcl.x86_64 1:8.5.13-8.el7 を インストール
--> 依存性解決を終了しました。

依存性を解決しました

================================================================================
 Package                  アーキテクチャー
                                      バージョン                リポジトリー
                                                                           容量
================================================================================
インストール中:
 php70-php-xml            x86_64      7.0.13-1.el7.remi         remi      162 k
依存性関連でのインストールをします:
 environment-modules      x86_64      3.2.10-10.el7             base      107 k
 php70-php-common         x86_64      7.0.13-1.el7.remi         remi      584 k
 php70-php-json           x86_64      7.0.13-1.el7.remi         remi       56 k
 php70-runtime            x86_64      1.0-5.el7.remi            remi      1.1 M
 scl-utils                x86_64      20130529-17.el7_1         base       24 k
 tcl                      x86_64      1:8.5.13-8.el7            base      1.9 M

トランザクションの要約
================================================================================
インストール  1 パッケージ (+6 個の依存関係のパッケージ)

総ダウンロード容量: 3.9 M
インストール容量: 9.3 M
Is this ok [y/d/N]: y
Downloading packages:

となります。AWSを使っていて、t2.microの場合はメモリ不足エラーが出ます。t2.small以上にしましょう。
現場からは以上。

7
8
1

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
7
8