PHP(5.2.0)とSmartyを使用して処理と表示でページを分けた課題をやることになりました。
ですが、Smarty-3.1.30をダウンロードしてサイトの通りに設定してもエラーが出てきてしまいます。
Smarty.class.phpの場所は、
C:\pleiades\xampp\php\Smarty\Smarty.class.php で
変更内容は
protected $template_dir = array('/xampp/htdocs/project/templates/');と
protected $compile_dir = '/xampp/htdocs/project/templates_c/';です。
php.iniの変更内容は
include_path = ".;c:\pleiades\xampp\php\PEAR;c:\pleiades\xampp\php\Smarty"
でSmarty.class.phpの場所を設定しています。
Apacheを起動して動かそうとするとエラーが発生してしまいます。
発生している問題・エラーメッセージ
Warning: require_once(Smarty/Smarty.class.php): failed to open stream: No such file or directory in C:\pleiades\xampp\htdocs\project\smarty_check.php on line 3 Fatal error: require_once(): Failed opening required 'Smarty/Smarty.class.php' (include_path='.;c:\pleiades\xampp\php\PEAR;c:\pleiades\xampp\php\Smarty') in C:\pleiades\xampp\htdocs\project\smarty_check.php on line 3
該当のソースコード
<?php require_once('Smarty/Smarty.class.php'); $smarty = new Smarty; $smarty->template_dir = './templates/'; $smarty->compile_dir = './templates_c/'; $smarty->assign('name', 'へびさん'); $smarty->display('index.tpl'); ?>
試したこと
Smartyをダウンロードしたり、サイトを変えてみたり試しましたが、変わりませんでした。
初心者のため、自分ではわからないのでご教授宜しくお願い致します。
あなたの回答
tips
プレビュー