Ubuntu 20.04 で確認した方法です。
ライブラリーのダウンロード
wget https://github.com/smarty-php/smarty/archive/v3.1.35.tar.gz
インストール
v3.1.35.tar.gz を解凍して、/usr/local/lib 以下に置く
サンプルプログラム
フォルダー構造
$ tree
.
├── templates
│ └── hello.tpl
├── templates_c
└── test.php
templates_c で書き込めるようにして置く。777 なら確実に書き込める。
test.php
<?php
define('SMARTY_DIR', '/usr/local/lib/smarty-3.1.35/libs/');
require_once(SMARTY_DIR . 'Smarty.class.php');
$smarty = new Smarty();
$smarty->template_dir = "./templates/";
$smarty->compile_dir = "./templates_c/";
$name = $_GET['name'];
$smarty->assign("name", $name);
$smarty->display("hello.tpl");
?>
hello.tpl
<!DOCTYPE html>
<html lang="ja">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Hello World!</title>
</head>
<body>
このページは Template です。<p />
<blockquote>
<h2>こんにちは {$name}!</h2>
</blockquote>
<p />
<hr />
Aug/29/2020 PM 13:22<p />
</body>
</html>
実行結果
test.php?name=新美南吉
test.php?name=宮沢賢治