Home | Registrieren | Einloggen | Suchen | Aktuelles


Forum » PHP & MySQL » Smarty Einstellungen Antworten
Smarty Einstellungen

aykut
Otto-Normal-Poster


Beiträge: 82


Ich bekomme folgende Fehlermeldung
Warning: Smarty error: unable to read resource: "index.tpl" in C:\Programme\Apache Group\Apache2\htdocs\friseur\db\smarty\libs\Smarty.class.php on line 1088


Umgebung: Apache: 2.0.54, Php. 4.4.0, Smarty-2.6.10, MySQL 4.1.14

Verzeichnis, wo sich die beiden Webseiten in unterschiedlichen Unterverzeichnissen befinden:
C:\Programme\Apache Group\Apache2\htdocs\
C:\Programme\Apache Group\Apache2\htdocs\website1\
C:\Programme\Apache Group\Apache2\htdocs\website2\

Ich möchte, daß sich smarty jeweils in dem jeweiligen websites befindet,
d.h. ich würde doppelte Aufwand betreiben, (gewollt).

website1
|------db
| '------smarty
| '------libs (hier befindet sich Smarty.class.php)
'------smartyrules
|------cache
|------configs
|------templates
'------templates_c

SMARTY Config
website1\smartyrules\libs.inc.php
1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
19: 
20: 
21:
<?php
	# Filename: libs.inc.php
	# the exact path is defined.
	$fixpath = dirname(__FILE__)."/";

	# changes this value according to your uploaded smarty distribution.
	# don't forget to add trailing back slash
	# change 'username' to your username on web hosting account
	
	define ("SMARTY_DIR",$fixpath."../db/smarty/libs/");		
	require_once (SMARTY_DIR."Smarty.class.php");

	$smarty = new Smarty;
	
	$smarty->template_dir = "$fixpath/templates";
	$smarty->compile_dir = "$fixpath/templates_c";
	$smarty->cache_dir  = "$fixpath/cache";
	$smarty->config_dir = "$fixpath/configs";
	
	$smarty->clear_compiled_tpl();
?>


SMARTY Einbinden
website1\db\db.php
1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
10:
<?
include("common.php");
require_once("smartyrules/libs.inc.php");

$server = "localhost";
$user = "";
$pass = "";
$database = "";
...
?>


SMARTY benutzen Teil 1
website1\index.php
1: 
2: 
3: 
4: 
5: 
6: 
7:
<?
include("db/db.php");

$smarty->assign('name', 'Ned');
$smarty->display('index.tpl');

?> 


SMARTY benutzen Teil 2
website1\index.tpl
1: 
2: 
3: 
4: 
5: 
6: 
7: 
8:
<html>
<head>
    <title>Smarty</title>
</head>
<body>
     Hello, {$name}!
</body>
</html>


Wie kann ich die eingangs gestellte Fehlermeldung wegbekommen?

Danke
Aykut

Diese Nachricht wurde geändert von: aykut
  Profil   Editieren   Zitieren

aykut
Otto-Normal-Poster


Beiträge: 82


Ich habe die Ursache gefunden. Mit der neuen Version stimmt was nicht.
Ich habe eine alte Version, die bei mir schon mal bei einem anderen Projekt lief, eingesetzt. Dann lief es!
Die Installationsbeschreibung hatte ich aus der Smarty Webseite übernommen gehabt,
d.h. an der Art und Weise der Installation dürfte es nicht liegen.
Naja, mit der alten Version läufts.

-Aykut

  Profil   Editieren   Zitieren

languitar
Foren-Team


Beiträge: 2795


also für mich sieht das eindeutig nach einem Pfad-Problem aus, aber ich kann das so auch nicth nachvollziehen....

---
Take a look here!
Lichtblick - Einblick - Ausblick

  Profil   E-Mail   Website   Editieren   Zitieren
 

Antworten
Nach oben