[PHP-users 17259]Smatyがうまく動作しない。

MAO mao @ nextyle.com
2003年 8月 8日 (金) 22:45:58 JST


MAOです。
いつも、質問ばかりで申し訳ないです。

現在、Smartyをインストールをして、
稼動させようとしているのですが、
うまくいかないので教えてください。

/home/www/httpd/html/test.php
/home/www/httpd/html/templates/test.tpl
/home/www/httpd/html/templates_c
/home/www/httpd/html/configs
/home/www/httpd/html/cache
といった、ファイル構造なのですが、、


<?php
	require('Smarty.class.php');
	$smarty = new Smarty;
	$TMPL = 'test.tpl';
	$smarty->display($TMPL);
?>
で実行したところ、問題なく動きます。


それを、
<?php
	require('Smarty.class.php');
	$smarty = new Smarty;
	$smarty->template_dir = '/home/www/httpd/html/templates';
	$smarty->compile_dir = '/home/www/httpd/html/templates_c';
	$smarty->config_dir = '/home/www/httpd/html/configs';
	$smarty->cache_dir = '/home/www/httpd/html/cache';
	$TMPL = 'test.tpl';
	$smarty->display($TMPL);
?>

にしたところ、
Warning: Smarty error: unable to read template resource: "test.tpl"
in /usr/local/lib/php/Smarty/Smarty.class.php on line 1042

と、エラーがでて、テンプレートが読み込めず実行ができません。
パスを疑いましたが、パスはあっているようです。
パーミッションやユーザも確認しましたが、
apacheのユーザと同じでその上777にパーミッションを
してみてもだめです。

環境はPHP4.3.2 vineLinux 2.6です。

同様のことをREDHAT PHP4.2.3でおこなったところ、
問題なく動きました。

PHPコンフィグはVineの方は最低限で、mbstringとmbregexだけです。
RedHatは日本語関連いがいにXMLなどのオプションをつけています。

お知恵をいただけないでしょうか?
よろしくおねがいいたします。



PHP-users メーリングリストの案内