2
3

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.

CentOSにSmartyをインストール

Posted at

Linux環境に不慣れな私が簡単に試したかったので残しておく。
PHPが入ってることは前提。
バージョンなど、必要条件は公式でご確認のほどを。

wgetとunzipが無い場合は手に入れる

# yum -y install wget
# yum -y install unzip

フォルダ移動

# cd /usr/local/lib

Smartyをダウンロード

# wget https://github.com/smarty-php/smarty/archive/master.zip

解凍する

# unzip master.zip

ドキュメントルートに、下記PHPを配置

test.php
<?php
require_once('/usr/local/lib/smarty-master/libs/Smarty.class.php');
$smarty = new Smarty();
?>

アクセス

http://ルートURL/test.php にアクセスしてエラーが出なければOK!

終わり

私の開発環境です。 実際に運用したい場合はいろんな設定が必要だと思います。

参考
https://www.smarty.net/docsv2/ja/installing.smarty.basic.tpl

2
3
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
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?