さくらのVPSのCentOS6.4で、PHP5.5を入れる方法
yum install php
でも、しようものなら、バージョンの低いPHPがインストールされてしまう(´・ω・`)
そうなると、残念ながら
$test = [ 'a' => 'test', 'b' => 'test2' ];
のようなスマートなarrayの書き方が出来なかったりする。
それは辛いので、さくっとレポジトリを追加して、PHPのバージョンをあげてみる。
remiのレポジトリを追加
$ sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm http://rpms.famillecollet.com/enterprise/remi-release-6.rpm を取得中 警告: /var/tmp/rpm-tmp.BIr873: ヘッダ V3 DSA/SHA1 Signature, key ID 00f97f56: NOKEY 準備中... ########################################### [100%] 1:remi-release ########################################### [100%]
$ ls /etc/yum.repos.d/ CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo epel-testing.repo epel.repo remi.repo
ほんでから、さくっとインストール!!!!
$ sudo yum install --enablerepo=remi --enablerepo=remi-php55 php php-devel php-gd php-mbstring php-mysql php-pdo php-pgsql php-mcrypt php-xml php-phpunit-PHPUnit php-pecl-xdebug
phpのバージョンを確認してOK〜
$ php -v PHP 5.5.8 (cli) (built: Jan 9 2014 08:14:44) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
あとは、apache立ち上げてphpinfo()でもして見てくださいな〜
ノシノシ