前提
現在zend framework2のプロジェクト【myalbums】をxampp/htdocs/に作成。
smarty4.3を以下のサイトを参考にダウンロードして【myalbums】直下にindex.phpを作成したのですがブラウザに表示させることができません。
参考サイト;http://vdeep.net/php-smarty
現状のエラーURL;http://127.0.0.1:8888/myalbums/index.php
急遽zendとsmartyについてキャッチアップしなければならなくなり、どなたかご助言頂けませんでしょうか。
■■index.php(ディレクト;C:\xampp\htdocs\myalbums\index.php)
//C:\xampp\htdocs\myalbums\smarty\Autoloader.php <?php // smartyの設定ファイル読み込み require_once(realpath(__DIR__) . "/smarty/Autoloader.php"); Smarty_Autoloader::register(); $name = 'okutani'; $obj = new StdClass(); $obj->hello = 'こんにちは!'; $smarty = new Smarty(); $smarty->assign('name', $name); $smarty->assign('obj', $obj); $smarty->display('index.tpl');
■■index.tpl(C:\xampp\htdocs\myalbums\templates\index.tpl)
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Smartyテスト</title> <link rel="stylesheet" href="comn/style.css"> </head> <body> {* ここはコメントです *} やあ、{$obj->hello} {$name} </body> </html>
### 発生している問題・エラーメッセージ このページは現在機能していません 127.0.0.1 から無効な応答が送信されました。 ERR_INVALID_HTTP_RESPONSE
### php.ini ; UNIX: "/path1:/path2" include_path=C:\xampp\htdocs\myalbums ; ; Windows: "\path1;\path2" include_path = ".;c:\php\includes;C:\xampp\htdocs\myalbums\smarty"
試したこと
apacheの再起動も何度かphp.iniの変更合わせて試したけど失敗。
ディレクトリの問題かと他の似たような事例も見て試してみたのですが、うまくいっていません。
あなたの回答
tips
プレビュー