ユーザ用ツール

サイト用ツール

Writing /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/lei_wiki/data/cache/b/b6609888bd998bf5f1aac60b67d52a76.i failed
Unable to save cache file. Hint: disk full; file permissions; safe_mode setting.
Writing /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/lei_wiki/data/cache/b/b6609888bd998bf5f1aac60b67d52a76.metadata failed

codeigniter基本
Writing /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/lei_wiki/data/cache/b/b6609888bd998bf5f1aac60b67d52a76.i failed
Unable to save cache file. Hint: disk full; file permissions; safe_mode setting.
Writing /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/lei_wiki/data/cache/b/b6609888bd998bf5f1aac60b67d52a76.xhtml failed

codeigniter基本

codeigniterについて

ダウンロード

公式日本語サイトからダウンロードします。

ダウンロードしたファイルを展開し開発環境に配置します。 Eclipseの場合、PDTでPHPプロジェクトを作成し、ダウンロードしたファイルをそのプロジェクト配下に配置します。

設定変更

.htaccessの作成

# Rewrite
<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond $1 !^(index\.php|css|user_guide|.+\.gif$|.+\.jpg$|.+\.png$|.+\.js$|robots\.txt)
 RewriteRule ^(.*)$ /shop/index.php/$1 [L]
</IfModule>

CodeIgniterの設定

/system/application/config/config.php

$config['base_url']	= '';

↓変更

$config['base_url']	= '/';
$config['uri_protocol']	= 'AUTO';

↓変更

$config['uri_protocol']	= 'REQUEST_URI';
$config['url_suffix'] = '';

↓変更

$config['url_suffix'] = '.html';
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';

↓変更

$config['permitted_uri_chars'] = '一-龠ぁ-んァ-ヴーA-Z0-9+=a-z 0-9~%.:_\-';


$config['enable_query_strings'] = FALSE;

↓変更

$config['enable_query_strings'] = TRUE;
$config['sess_encrypt_cookie']	= FALSE;

↓変更

$config['sess_encrypt_cookie']	= TRUE;
$config['global_xss_filtering'] = FALSE;

↓変更

$config['global_xss_filtering'] = TRUE;
$config['rewrite_short_tags'] = FALSE;

↓変更

$config['rewrite_short_tags'] = TRUE;
/*
|--------------------------------------------------------------------------
| DB設定
|--------------------------------------------------------------------------
|
*/
$db['default']['hostname'] = '【データベース接続情報の Host】';
$db['default']['username'] = '【データベース接続情報の User】';
$db['default']['password'] = '【データベース接続情報の Password】';
$db['default']['database'] = '【データベース接続情報の Name】';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

/httpdocs/shop/application/config/routes.php

$route['default_controller'] = "welcome";

↓に変更

$route['default_controller'] = "index";

Smarty実装

1. /httpdocs/shop/application/autoload.php

$autoload['libraries'] = array();

↓に変更

$autoload['packages'] = array(APPPATH . 'third_party/smarty');
$autoload['libraries'] = array('smarty');

2./system/libs/smarty/libs/にSmartyライブラリを追加する。

3./application/views/templates

4./applicatino/views/tmplates_c

5./shop/system/core/Controller.php

$this->smarty->template_dir = APPPATH . 'views/templates';
$this->smarty->compile_dir  = APPPATH . 'views/templates_c';
codeigniter基本.txt · 最終更新: 2014/11/26 17:26 by luis_lee