- 追加された行はこの色です。
- 削除された行はこの色です。
#author("2018-12-05T15:50:40+09:00","default:wikiwriter","wikiwriter")
#author("2019-03-25T05:54:00+00:00","default:wikiwriter","wikiwriter")
&tag(CentOS6/PHP);
*目次 [#pd5dd85c]
#contents
*関連ページ [#lfd8e22f]
*参考情報 [#j4c50fd8]
*インストール [#mf0fd08b]
-以下のコマンドでインストールできる
yum install php php-mysql
-mod_phpの設定は自動的に行われる。
*PHP5.6のインストール [#x8fc3737]
**参考情報 [#ue830368]
-[[CentOS6/CentOS7にPHP5.6/PHP7をyumでインストール - Qiita:https://qiita.com/ozawan/items/caf6e7ddec7c6b31f01e]]
**リポジトリの準備 [#m2959e9e]
-[[../外部リポジトリの追加]]に従いepelとremiを有効にしておく。
**インストール [#f915a265]
まず現在のバージョンの確認と削除。
rpm -qa | grep php
yum remove php-*
インストールする。yum-prioritiesを使用している場合「disableplugin=priorites」を指定しないとだめかも(もしくはremiの優先度を上げておくか)。
yum install --disableplugin=priorities --enablerepo=remi,remi-php56 php php-devel php-mbstring php-pdo php-gd php-xml php-mcrypt
**設定 [#hd31551d]
/etc/php.iniのmbstringを変更。
#pre{{
[mbstring]
mbstring.language = Japanese
mbstring.internal_encoding = UTF-8
;mbstring.http_input = auto
mbstring.http_input = UTF-8
mbstring.http_output = UTF-8
mbstring.encoding_translation = On
mbstring.detect_order = auto
mbstring.substitute_character = none
mbstring.func_overload = 0
}}
-http_input=autoだとPukiWikiが文字化けしたからUTF-8に変更。
-DokuWikiを動かす場合mbstring.func_overload = 0じゃないとだめ。
**yum updateでエラー [#c3b939f8]
-2019/03/25(月)yum updateで以下のようなエラーが発生。
#pre{{
---> Package php-mcrypt.x86_64 0:5.6.40-5.el6.remi will be an update
--> 依存性の処理をしています: php-common(x86-64) = 5.6.40-5.el6.remi のパッケージ: php-mcrypt-5.6.40-5.el6.remi.x86_64
--> 依存性解決を終了しました。
エラー: パッケージ: php-mcrypt-5.6.40-5.el6.remi.x86_64 (remi-php56)
要求: php-common(x86-64) = 5.6.40-5.el6.remi
インストール: php-common-5.6.38-2.el6.remi.x86_64 (@remi-php56)
php-common(x86-64) = 5.6.38-2.el6.remi
利用可能: php-common-5.3.3-49.el6.x86_64 (base)
php-common(x86-64) = 5.3.3-49.el6
問題を回避するために --skip-broken を用いることができません
}}
-標準のphpとremiのphpが衝突しているのが原因らしい。[[CentOS 6 で yum update した時、remi-php70 レポジトリ内のパッケージの依存性解決ができない場合の解決方法 | ラボラジアン:https://laboradian.com/centos6-yum-update-remi-php70-error/]]。
-/etc/yum.repos.dのremi.repoの[remi-php56]に以下を追加。
enabled=1
-CentOS-Base.repoの[base]と[updates]に以下を追加。
exclude=php*