4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

PHP

4
Posted at

依存パッケージのインストール

# yum install re2c bison-devel libxml2-devel openssl-devel libcurl-devel libjpeg-devel libpng-devel libmcrypt-devel readline-devel libtidy-devel libxslt-devel

PHP のインストール

  • 以下のコマンドでインストール可能な PHP バージョンを確認
$ phpenv install --releases
  • 任意の PHP バージョンをインストール
# phpenv install 5.5.18
  • インストールした PHP を有効化
# phpenv global 5.5.18
# phpenv rehash
# php -v
PHP 5.5.18 (cli) (built: Nov 11 2014 12:01:59)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
    with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans

PHP の設定変更

  • php.ini のバックアップ
# cd /usr/local/phpenv/versions/5.5.18/etc
# cp -ip php.ini php.ini.org
  • タイムゾーン設定
(変更前)
;date.timezone =

(変更後)
date.timezone = Asia/Tokyo
  • HTTP ヘッダ出力の抑制
(変更前)
expose_php = On

(変更後)
expose_php = Off
  • 文字コード設定
(変更前)
;mbstring.language = Japanese
;default_charset = "UTF-8"

(変更後)
mbstring.language = Japanese
default_charset = "UTF-8"
  • 設定の有効化
# phpenv global 5.5.18
# phpenv rehash
4
3
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
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?