33
33

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.

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

Last updated at Posted at 2015-05-23

####■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

33
33
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
33
33

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?