Smartyをインストールする

さくらVPSではもちろん、Smartyがインストールされてないので、
Smartyをインストールします。

最新版のURLは以下から確認してください。
http://www.smarty.net/download

1. Smartyをダウンロード

# wget http://www.smarty.net/files/Smarty-3.1.14.tar.gz
--2013-09-29 00:50:43--  http://www.smarty.net/files/Smarty-3.1.14.tar.gz
Resolving www.smarty.net... 192.198.198.106
Connecting to www.smarty.net|192.198.198.106|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 204991 (200K) [application/x-gzip]
Saving to: `Smarty-3.1.14.tar.gz'

100%[===============================================================>] 204,991      261K/s   in 0.8s

2013-09-29 00:50:44 (261 KB/s) - `Smarty-3.1.14.tar.gz' saved [204991/204991]

2. 展開

# ls
MyFunctions.php  Smarty-3.1.14.tar.gz  go-pear.phar
[root@www12079uh ~]# tar xvfz Smarty-3.1.14.tar.gz
Smarty-3.1.14/
Smarty-3.1.14/demo/
Smarty-3.1.14/demo/templates/
Smarty-3.1.14/demo/templates/header.tpl
Smarty-3.1.14/demo/templates/index.tpl
Smarty-3.1.14/demo/templates/footer.tpl
Smarty-3.1.14/demo/templates_c/
Smarty-3.1.14/demo/index.php
Smarty-3.1.14/demo/cache/
Smarty-3.1.14/demo/configs/
Smarty-3.1.14/demo/configs/test.conf
Smarty-3.1.14/demo/plugins/
Smarty-3.1.14/demo/plugins/resource.extendsall.php
Smarty-3.1.14/demo/plugins/cacheresource.apc.php
Smarty-3.1.14/demo/plugins/cacheresource.mysql.php
Smarty-3.1.14/demo/plugins/cacheresource.memcache.php
Smarty-3.1.14/demo/plugins/resource.mysqls.php
Smarty-3.1.14/demo/plugins/resource.mysql.php
Smarty-3.1.14/change_log.txt
Smarty-3.1.14/SMARTY_3.0_BC_NOTES.txt
Smarty-3.1.14/SMARTY_2_BC_NOTES.txt
Smarty-3.1.14/COPYING.lib
Smarty-3.1.14/libs/
Smarty-3.1.14/libs/debug.tpl
Smarty-3.1.14/libs/sysplugins/
Smarty-3.1.14/libs/sysplugins/smarty_cacheresource.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_templatebase.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_assign.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_nocache_insert.php
Smarty-3.1.14/libs/sysplugins/smarty_resource_recompiled.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_modifier.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_filter_handler.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_config_file_compiler.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_config.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_templatecompilerbase.php
Smarty-3.1.14/libs/sysplugins/smarty_security.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_registered.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_while.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_capture.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_file.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_extends.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_setfilter.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_cacheresource_file.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_foreach.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_insert.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_function_plugin.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_string.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_break.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_data.php
Smarty-3.1.14/libs/sysplugins/smarty_resource_uncompiled.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_include.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_smartytemplatecompiler.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_configfilelexer.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_php.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_configfileparser.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_object_function.php
Smarty-3.1.14/libs/sysplugins/smarty_cacheresource_keyvaluestore.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_debug.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_if.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_config_load.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_include_php.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_template.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_function.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_ldelim.php
Smarty-3.1.14/libs/sysplugins/smarty_resource.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_append.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_section.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_eval.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_print_expression.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_continue.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_block.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_templatelexer.php
Smarty-3.1.14/libs/sysplugins/smarty_config_source.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_rdelim.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_registered_function.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_stream.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_resource_eval.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_for.php
Smarty-3.1.14/libs/sysplugins/smarty_resource_custom.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_special_variable.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compilebase.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_call.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_object_block_function.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_get_include_path.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_nocache.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_write_file.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_debug.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_block_plugin.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_function_call_handler.php
Smarty-3.1.14/libs/sysplugins/smarty_cacheresource_custom.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_utility.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_templateparser.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_extends.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_compile_private_registered_block.php
Smarty-3.1.14/libs/sysplugins/smarty_internal_parsetree.php
Smarty-3.1.14/libs/plugins/
Smarty-3.1.14/libs/plugins/modifiercompiler.from_charset.php
Smarty-3.1.14/libs/plugins/modifiercompiler.to_charset.php
Smarty-3.1.14/libs/plugins/modifiercompiler.unescape.php
Smarty-3.1.14/libs/plugins/outputfilter.trimwhitespace.php
Smarty-3.1.14/libs/plugins/modifiercompiler.escape.php
Smarty-3.1.14/libs/plugins/function.mailto.php
Smarty-3.1.14/libs/plugins/modifiercompiler.cat.php
Smarty-3.1.14/libs/plugins/function.html_checkboxes.php
Smarty-3.1.14/libs/plugins/function.counter.php
Smarty-3.1.14/libs/plugins/modifier.replace.php
Smarty-3.1.14/libs/plugins/modifier.debug_print_var.php
Smarty-3.1.14/libs/plugins/modifiercompiler.count_paragraphs.php
Smarty-3.1.14/libs/plugins/modifier.date_format.php
Smarty-3.1.14/libs/plugins/modifiercompiler.upper.php
Smarty-3.1.14/libs/plugins/function.fetch.php
Smarty-3.1.14/libs/plugins/modifiercompiler.strip_tags.php
Smarty-3.1.14/libs/plugins/modifiercompiler.count_sentences.php
Smarty-3.1.14/libs/plugins/modifier.truncate.php
Smarty-3.1.14/libs/plugins/function.cycle.php
Smarty-3.1.14/libs/plugins/modifier.regex_replace.php
Smarty-3.1.14/libs/plugins/function.html_image.php
Smarty-3.1.14/libs/plugins/function.html_table.php
Smarty-3.1.14/libs/plugins/modifiercompiler.lower.php
Smarty-3.1.14/libs/plugins/modifier.capitalize.php
Smarty-3.1.14/libs/plugins/modifiercompiler.noprint.php
Smarty-3.1.14/libs/plugins/modifiercompiler.count_characters.php
Smarty-3.1.14/libs/plugins/function.html_options.php
Smarty-3.1.14/libs/plugins/block.textformat.php
Smarty-3.1.14/libs/plugins/shared.literal_compiler_param.php
Smarty-3.1.14/libs/plugins/modifier.spacify.php
Smarty-3.1.14/libs/plugins/shared.mb_wordwrap.php
Smarty-3.1.14/libs/plugins/shared.make_timestamp.php
Smarty-3.1.14/libs/plugins/modifiercompiler.count_words.php
Smarty-3.1.14/libs/plugins/modifiercompiler.indent.php
Smarty-3.1.14/libs/plugins/shared.mb_str_replace.php
Smarty-3.1.14/libs/plugins/function.html_select_date.php
Smarty-3.1.14/libs/plugins/shared.escape_special_chars.php
Smarty-3.1.14/libs/plugins/modifiercompiler.wordwrap.php
Smarty-3.1.14/libs/plugins/function.html_select_time.php
Smarty-3.1.14/libs/plugins/modifiercompiler.string_format.php
Smarty-3.1.14/libs/plugins/function.html_radios.php
Smarty-3.1.14/libs/plugins/shared.mb_unicode.php
Smarty-3.1.14/libs/plugins/modifier.escape.php
Smarty-3.1.14/libs/plugins/function.math.php
Smarty-3.1.14/libs/plugins/modifiercompiler.strip.php
Smarty-3.1.14/libs/plugins/modifiercompiler.default.php
Smarty-3.1.14/libs/plugins/variablefilter.htmlspecialchars.php
Smarty-3.1.14/libs/Smarty.class.php
Smarty-3.1.14/libs/SmartyBC.class.php
Smarty-3.1.14/README
Smarty-3.1.14/SMARTY_3.1_NOTES.txt

3. 好きな場所にlibsフォルダを移動します

展開が終わったら、展開されたファイルの中にあるlibsディレクトリを適当な
場所に移動すればインストール官僚です。

いかでは、”/usr/local/lib/Smarty”に配置してます。

# mv Smarty-3.1.14/libs/ /usr/local/lib/Smarty

pearをインストールする

さくらvpsでは初期状態では、pearがインストールされてません。

そこで、pearをインストールします。

# wget http://pear.php.net/go-pear.phar
--2013-09-29 00:44:53--  http://pear.php.net/go-pear.phar
Resolving pear.php.net... 5.77.39.20
Connecting to pear.php.net|5.77.39.20|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4082712 (3.9M) [application/octet-stream]
Saving to: `go-pear.phar'

100%[===============================================================>] 4,082,712   1.01M/s   in 3.9s

2013-09-29 00:44:58 (1.01 MB/s) - `go-pear.phar' saved [4082712/4082712]

# ls
go-pear.phar
# php go-pear.phar

Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.

 1. Installation base ($prefix)                   : /usr
 2. Temporary directory for processing            : /tmp/pear/install
 3. Temporary directory for downloads             : /tmp/pear/install
 4. Binaries directory                            : /usr/bin
 5. PHP code directory ($php_dir)                 : /usr/share/pear
 6. Documentation directory                       : /usr/docs
 7. Data directory                                : /usr/data
 8. User-modifiable configuration files directory : /usr/cfg
 9. Public Web Files directory                    : /usr/www
10. Tests directory                               : /usr/tests
11. Name of configuration file                    : /etc/pear.conf

1-11, 'all' or Enter to continue:
Beginning install...
PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Tokyo' for 'JST/9.0/no DST' instead in phar:///root/go-pear.phar/PEAR/Registry.php on line 1012
PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Tokyo' for 'JST/9.0/no DST' instead in phar:///root/go-pear.phar/PEAR/Registry.php on line 1012
PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Tokyo' for 'JST/9.0/no DST' instead in phar:///root/go-pear.phar/PEAR/Registry.php on line 1012
PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Tokyo' for 'JST/9.0/no DST' instead in phar:///root/go-pear.phar/PEAR/Registry.php on line 1012
Configuration written to /etc/pear.conf...
Initialized registry...
Preparing to install...
installing phar:///root/go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.3.11.tar...
installing phar:///root/go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-1.3.1.tar...
installing phar:///root/go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.9.4.tar...
installing phar:///root/go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.0.4.tar...
installing phar:///root/go-pear.phar/PEAR/go-pear-tarballs/XML_Util-1.2.1.tar...
install ok: channel://pear.php.net/Archive_Tar-1.3.11
install ok: channel://pear.php.net/Console_Getopt-1.3.1
install ok: channel://pear.php.net/Structures_Graph-1.0.4
install ok: channel://pear.php.net/XML_Util-1.2.1
install ok: channel://pear.php.net/PEAR-1.9.4
PEAR: Optional feature webinstaller available (PEAR's web-based installer)
PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)
PEAR: To install optional features use "pear install pear/PEAR#featurename"

The 'pear' command is now at your service at /usr/bin/pear

** The 'pear' command is not currently in your PATH, so you need to
** use '/usr/bin/pear' until you have added
** '/usr/bin' to your PATH environment variable.

Run it without parameters to see the available actions, try 'pear list'
to see what packages are installed, or 'pear help' for help.

For more information about PEAR, see:

http://pear.php.net/faq.php


http://pear.php.net/manual/

Thanks for using go-pear!