teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

公式のインストール手順に従って、libsの配置先を変更。

2017/01/07 08:25

投稿

TeraTaka0614
TeraTaka0614

スコア7

title CHANGED
File without changes
body CHANGED
@@ -1,3 +1,12 @@
1
+ ###追記
2
+ コメントを参考に構成を変更しました。
3
+ ```
4
+ libsの配置を以下に変更
5
+ 旧)/var/www/html/smarty-compile-check/libs/
6
+ 新)/usr/local/lib/smarty-3.1.30/libs/
7
+ ※smarty-3.1.30は、サイトからDLしたものを解凍してそのまま配置しています。
8
+ ```
9
+
1
10
  ###発生している問題と達成したいこと
2
11
  $smarty->display(~~) を実行したとき、以下のエラーで弾かれてしまいます。
3
12
  ```
@@ -28,19 +37,24 @@
28
37
  www/
29
38
  html/
30
39
  smarty-compile-check/
31
- libs/
32
40
  templates/
33
41
  index.tpl
34
42
  templates_c/
35
43
  cache/
36
44
  index.php
45
+ /usr/
46
+ local/
47
+ lib/
48
+ smarty-3.1.30/
49
+ libs/
37
50
  ```
38
51
 
39
52
  ###index.phpとindex.tplの中身
40
53
  index.php
41
54
  ```php
42
55
  <?php
56
+ define("SMARTY_DIR", "/usr/local/lib/smarty-3.1.30/libs/");
43
- require_once(__DIR__ . "/libs/Smarty.class.php");
57
+ require_once(SMARTY_DIR . "Smarty.class.php");
44
58
  $smarty = new Smarty();
45
59
  $smarty->display("index.tpl");
46
60
  ```