1. PHP 5.2.5 w katalogu C:\PHP5.
2. IIS 6.0 w katalogu domyślnym tj. C:\Inetpub\wwwroot.
3. Moduł PEAR DB w C:\PHP5 (do późniejszej odsługi bazy danych MSSQL2005).
4. Obsługa PHP na IIS 6.0 ustawiona poprawnie jako ISAPI (php5isapi.dll). Dodam, że skrypt test.php (<?php phpinfo(); ?>) działa poprawnie. Inne skrypty PHP również.
5. Plik php.ini skopiowany do C:\Windows a ustawienia w nim są następujące:
- extension_dir = "C:\PHP5\ext"
- doc_root = "C:\Inetpub\wwwroot"
Problem jest ze SMARTY (wersja 2.6.14).
Mam coś takiego w C:\Inetpub\wwwroot:
|---smarty
---CVS
---internals
---plugins
---Config_File.class.php
---debug.tpl
---Smarty.class.php
---Smarty_Compiler.class.php
|---templates
--index.tpl
|---templates_c
---index.php
gdzie:
index.tpl
Kod
{* Szablon smarty *}
<h1>Strona 1</h1>
<div>
{if $imie}
Witaj {$imie}
{/if}
</div>
<h1>Strona 1</h1>
<div>
{if $imie}
Witaj {$imie}
{/if}
</div>
index.php
Kod
<?php
require_once('smarty/Smarty.class.php');
$smarty = new Smarty;
$smarty->template_dir = 'templates';
$smarty->compile_dir = 'templates_c';
$smarty->assign('imie', 'Jaś');
$smarty->display('index.tpl');
?>
require_once('smarty/Smarty.class.php');
$smarty = new Smarty;
$smarty->template_dir = 'templates';
$smarty->compile_dir = 'templates_c';
$smarty->assign('imie', 'Jaś');
$smarty->display('index.tpl');
?>
Po wpisaniu w IE url-a: http://localhost/index.php (lub http://127.0.0.1/index.php) nic się nie wyświetla. Co robię źle? Dodam, że pracuję na koncie Administratora i uprawnienia dałem na Pełna kontrola. W templates_c jednak nie tworzy się żadna kompilacja.
Dzięki za pomoc.