LoginSignup
5
4

More than 5 years have passed since last update.

PHP7でCakePHP3を動かしてみる

Posted at

PHP7上でCakePHP3動かしてみる

つい先日公開されたPHP7を使ってCakePHP3を動かしてみます。
ついでに簡単なベンチマークでも取ってみようと思います。

基本環境

  • CentOS 7.1(VM)
  • Apache 2.4

CakePHP3+PHP7インストール

PHP7のインストールにはおなじみのRemiを使わせてもらいました。

rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
yum --enablerepo=remi-php70,epel install php php-cli php-common php-mbstring php-fpm php-gd php-gmp php-mbstring php-mcrypt php-opcache php-pdo php-xml php-mysql php-intl

php確認

php -v
PHP 7.0.0 (cli) (built: Dec 1 2015 17:53:27) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies

Composer&CakePHP3インストール

curl -sS https://getcomposer.org/installer | php
php composer.phar create-project --prefer-dist cakephp/app cake3

ベンチマーク

今回比較用にPHP7+CakePHP2、PHP5.6+CakePHP3、PHP5.6+CakePHP2を用意しました。
一通りやったけどトップページじゃさすがに速度変わりませんでしたorz

対象ページはトップページにしておきます。

ab -n 10 -c 10 http://localhost/cake3/
  CakePHP3 CakePHP2
PHP7 505ms 508ms
PHP5.6 507ms 512ms

今度何かシステム作った時に改めて測り直します。

結論

触りだけですけどCakePHP3,CakePHP2系ともに問題なく動きました!!

5
4
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
5
4