Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
33
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

updated at

CakePHP3.0をインストールしてみる(自分用めもめも

■CakePHP3.0をインストール

・公式サイト->http://cakephp.org/

■プロジェクトの作成

$ php composer.phar create-project -s dev cakephp/app

■エラー

Your requirements could not be resolved to an installable set of packages.
 Problem1
  - Installation request for cakephp/cakephp 3.0.*-dev -> satisfiable by cakephp/cakephp[3.0.x-dev].
  - cakephp/cakephp 3.0.x-dev requires ext-intl * -> the requested PHP extension intl is missing from your system.
->php.intlがはいってない

■php.intlを探してみる

$ php -i | grep intl
->何も表示されなかった。入ってない証拠。

■php.intlをインストールする

# sudo pecl install intl
->peclコマンドが使えませんとエラーでる。

■peclをインストールする

# yum install php-pear
# pecl install intl
->ここでdefaultでおっけーか聞かれるからyでおっけいしておく。

■エラーがでる

ERROR: `/tmp/pear/temp/intl/configure --with-icu-dir=DEFAULT' failed

■もういちど

# yum install icu libicu-devel
# pecl install intl
->You should add "extension=intl.so" to php.iniって言われるので、その通りにする。

■php.iniにextension=intl.soを書き込む

# vi  /etc/php.ini
;;;;;;;;;;;;;;;;;;;;;;
 ; Dynamic Extensions ;  
 ;;;;;;;;;;;;;;;;;;;;;;
 extension=intl.so
 ; If you wish to have an extension loaded automatically, use the following
 ; syntax:

■サーバーの再起動

# service httpd restart

■データベースの設定

mysqlにrootでログインしてテーブルを作成する

mysql> create database xxx;
mysql> grant all on xxx.* to dbuser@localhost identified by 'xxx';

データベースに接続して、xxxxを書き換える

$ vi app/config/app.php

app.php

'Datasources' => [
        'default' => [
            'className' => 'Cake\Database\Connection',
            'driver' => 'Cake\Database\Driver\Mysql',
            'persistent' => false,
            'host' => 'localhost',
            /**
             * CakePHP will use the default DB port based on the driver selected
             * MySQL on MAMP uses port 8889, MAMP users will want to uncomment
             * the following line and set the port accordingly
             */
            //'port' => 'nonstandard_port_number',
            'username' => 'xxxx',
            'password' => 'xxxx',
            'database' => 'xxxx',
            'encoding' => 'utf8',
            'timezone' => 'UTC',
            'cacheMetadata' => true,

参考サイト
http://qiita.com/kozo/items/263de91d659cef7d5ab5
http://catcher-in-the-tech.net/278/
http://nagoring.com/blog/tag/cakephp3/
http://shouhei.github.io/blog/2014/12/05/cakephp3falsetiyutoriarunitiyarenzi!/
http://tekitoh-memdhoi.info/views/631
https://secure.nanako-net.info/redmine/projects/know-how/wiki/Php-pear
http://note.onichannn.net/archives/3107
http://anz-note.tumblr.com/post/96801260816/cakephp3-v3-1
http://tbrhdys.hatenablog.com/entry/2015/05/02/174214

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
33
Help us understand the problem. What are the problem?