2015年4月11日土曜日

Create cakephp and fundation project Page 1

Enviroment

  • vagrant centos6.5
  • php5.5
  • php-fpm
  • nginx1.6.2

move project root folder


cd {project_root_folder}

install composer


curl -sS https://getcomposer.org/installer | php

if your server uses chef, you may install composer by recipe. but, I don't recommend to do. Basically, php is instablity. php is not able to execute version controller. php is different from ruby or python.

create composer.json


touch composer.json

{
    "name": "test",
    "repositories": [
        {
            "type": "pear",
            "url": "http://pear.cakephp.org"
        }
    ],
    "require": {
        "cakephp/cakephp": "2.6.*"
    },
    "require-dev": {
        "cakephp/debug_kit": "2.2.*@dev",
        "phpunit/phpunit": "3.7.*"
    },
    "config": {
        "vendor-dir": "Vendor/"
    }
}

install composer.phar


php composer.phar install --dev

create project


cake bake project <path to project>

tmp permission change


chmod 777 tmp
chmod -R 777 tmp/

core.php add mask


/**
 * Configure the cache used for general framework caching. Path information,
 * object listings, and translation cache files are stored with this configuration.
 */
Cache::config('_cake_core_', array(
    'engine' => $engine,
    'prefix' => $prefix . 'cake_core_',
    'path' => CACHE . 'persistent' . DS,
    'serialize' => ($engine === 'File'),
    'duration' => $duration,
    'mask'=>0666
));

/**
 * Configure the cache for model and datasource caches. This cache configuration
 * is used to store schema descriptions, and table listings in connections.
 */
Cache::config('_cake_model_', array(
    'engine' => $engine,
    'prefix' => $prefix . 'cake_model_',
    'path' => CACHE . 'models' . DS,
    'serialize' => ($engine === 'File'),
    'duration' => $duration,
    'mask'=>0666
));


webroot/index.php change


define('CAKE_CORE_INCLUDE_PATH',  ROOT . DS . APP_DIR . DS . 'Vendor' . DS . 'cakephp' . DS . 'cakephp' . DS . 'lib');

↓

define('CAKE_CORE_INCLUDE_PATH',  ROOT . DS . 'Vendor' . DS . 'cakephp' . DS . 'cakephp' . DS . 'lib');

Config/database.php create


cp -a database.php.default database.php

 public $default = array(
  'datasource' => 'Database/Mysql',
  'persistent' => false,
  'host' => 'localhost',
  'login' => 'test',
  'password' => 'testtest',
  'database' => 'app_development',
  'prefix' => '',
  'encoding' => 'utf8',
 );

move plugin


// move plugin
mv Plugin/* {app_root}/Plugin/

// Config/bootrap.php
CakePlugin::load('DebugKit');

access


http://192.168.33.12/

Your version of PHP is 5.2.8 or higher.

Your tmp directory is writable.

The FileEngine is being used for core caching. To change the config edit APP/Config/core.php

Your database configuration file is present.

CakePHP is able to connect to the database.

DebugKit plugin is present

Displayed!!

thanks

この記事がお役にたちましたらシェアをお願いします

このエントリーをはてなブックマークに追加

0 件のコメント:

コメントを投稿

Related Posts Plugin for WordPress, Blogger...