Smarty

Alles, was PHP betrifft, kann hier besprochen werden.

Smarty

Postby Gast » 10. June 2003 16:50

Ich hab da nen riesen Problem:

Code: Select all
Warning: fetch(templates_c\%%117\%%1172603085\index.tpl.php) [function.fetch]: failed to open stream: No such file or directory in G:\wampp2\htdocs\neu\smarty\Smarty.class.php on line 1158

Warning: fetch() [function.include]: Failed opening 'templates_c\%%117\%%1172603085\index.tpl.php' for inclusion (include_path='\wampp2\php\pear\') in G:\wampp2\htdocs\neu\smarty\Smarty.class.php on line 1158


Meine php.ini sieht so aus:
Code: Select all
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
; include_path = ".;c:\"
include_path = ".;G:\wampp2\php\pear\;G:\wampp2\smarty250\"


Meine index.php so:
Code: Select all
<?
include("include.php");
define('SMARTY_DIR','smarty/');
require(SMARTY_DIR.'Smarty.class.php');
error_reporting(E_ALL);
$abfragecss = mysql_query("SELECT * FROM css");
$row = mysql_fetch_array($abfragecss);
$css = $row['link'];
$thema = $row['name'];
$smarty = new Smarty;   
$smarty->assign('css', $css);   
$smarty->assign('thema',$thema);   
$smarty->display('index.tpl'); ?>


Die index.tpl so:
Code: Select all
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
<title>Willkommen zum Webauftritt der Stufe 13 des Gymnasium xxx</title>
{$css}
</head>
<body class="index">
<p class="indeximg"> <img class="index" src="images/{$thema}/index.jpg" alt="Abikultur - {$thema}"/></p>
<div class="indexvalid"><a href="http://validator.w3.org/check?uri=http%3A%2F%2F62.227.134.133%2Fneu%2Findex.php"
><img src="images/valid/xthml10.jpg" class="indexvalid" alt="Diese Seite ist XHTML 1.0 strict" width="88" height="31"/></a>
<a href="http://jigsaw.w3.org/css-validator/validator?uri=http://62.227.134.133/neu/css/Mexiko.css">
<img src="images/valid/cssvalid.gif" class="indexvalid" width="88" height="31" alt="Die Seite ist CSS valid"/>
</a></div>
</body>
</html>


Wo liegt hier mein Fehler?
Ich hab im htdocs vrzeichnis 5 Verzeichnisse:

Code: Select all
templates (da liegt meine index.tpl)
templates_c (keine Ahnung)
cache (ka)
configs(leer)
smarty(Das entpackte smarty halt)


Wer kann mir helfen?
Gast
 

Postby chris17 » 11. June 2003 08:26

Gugug,
... ich hab' kein Plan von Smarty, also nur eine Vermutung:

--> No such file or directory in G:\wampp2\htdocs\neu\smarty\Smarty.class.php on line 1158

--> define('SMARTY_DIR','smarty/');

... das Verzeichnis zu Smarty scheint einfach nicht korrekt zu sein.
Hilfreich wäre auch was in line 1158 steht

Schau mal nach, ob Du diese "wirren" Ordner \%%117\%%1172603085 etc. direkt unter G:\ stehen hast...
chris17
 
Posts: 8
Joined: 05. June 2003 16:31

Postby Kai(nen anderer) » 11. June 2003 13:34

Naja lag wohl am Verzeichnis 'smarty\' != smarty\ 'smarty\\' ist richtig aber nu hab ich nen neuen Fehler (hab mal nen bissl umgestrickt:


include.php (smarty exestiert in wampp\)
Code: Select all
<?
define(SMARTY_DIR,'smarty\\');
require(SMARTY_DIR.'Smarty.class.php');
require(SMARTY_DIR.'Smarty_Compiler.class.php');
$smarty = new Smarty;
$normdir = 'G:\wampp2\smarty\\';
$smarty->template_dir = $normdir.'templates\\';
$smarty->compile_dir = $normdir.'templates_c\\';
$smarty->config_dir = $normdir.'configs\\';
$smarty->cache_dir = $normdir.'cache\\';
$verbindung = mysql_connect("localhost","","") or die ("Keine Verbindung zum localhost moeglich, möglicherweise ist das Passwort falsch");
mysql_select_db("abi") or die ("Diese Datenbank exestiert nicht");
?>


index.php:
Code: Select all
<?
require("include.php");
error_reporting(E_ALL);
$abfragecss = mysql_query("SELECT * FROM css");
$row = mysql_fetch_array($abfragecss);
mysql_free_result($abfragecss);
$css2 = $row['link'];
$thema2 = $row['name'];
$smarty->assign('css', $css2);
$smarty->assign('clanname',$thema2);
$smarty->display('index.tpl');
?>

Meine php.ini (bissl umgestrickt):
Code: Select all

;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
; include_path = ".;c:\"
include_path = \wampp2\php\pear\


Meine index.tpl:
Code: Select all
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
<title>Willkommen zum Webauftritt der Stufe 13 des xxx</title>

{$css}
</head>
<body class="index">
<h1 class="index">Derzeitiges Thema: Mexiko</h1>
<p class="indeximg"> <img class="index" src="images/{$thema}/index.jpg" alt="Abikultur - {$thema}"/></p>
<div class="indexvalid"><a href="http://validator.w3.org/check?uri=http%3A%2F%2F62.227.134.133%2Fneu%2Findex.php"
><img src="images/valid/xthml10.jpg" class="indexvalid" alt="Diese Seite ist XHTML 1.0 strict" width="88" height="31"/></a>
<a href="http://jigsaw.w3.org/css-validator/validator?uri=http://62.227.134.133/neu/css/Mexiko.css">
<img src="images/valid/cssvalid.gif" class="indexvalid" width="88" height="31" alt="Die Seite ist CSS valid"/>
</a></div>
</body>
</html>


Meine Fehlermeldung:
Code: Select all
Warning: _compile_template(smarty\Smarty_Compiler.class.php) [function.-compile-template]: failed to open stream: No such file or directory in G:\wampp2\htdocs\neu\smarty\Smarty.class.php on line 1708

Fatal error: _compile_template() [function.require]: Failed opening required 'smarty\Smarty_Compiler.class.php' (include_path='\wampp2\php\pear\') in G:\wampp2\htdocs\neu\smarty\Smarty.class.php on line 1708


Hab langsam die Faxen dicke...
Kai(nen anderer)
 

Postby ClausVB » 12. June 2003 12:10

Ich kann Deinen Frust nur zu gut verstehen. Ich habe genau die gleichen Probleme.

Ich habe alles auf
smarty.php.net - Installation
ausprobiert, aber es läuft einfach nicht.

Ich frage mich immer, warum versucht der einen Pfad anzulegen?

Naja, nach einer Stunde intensiver Suche habe ich dann aufgegeben.

Mein Tip: Wenn es möglich ist, benutze eine andere Templateklasse.

Ich nehme vLIB.

Vielleicht solltest Du in dem Forum von Smarty oder der Mailingliste nachsehen.
User avatar
ClausVB
 
Posts: 32
Joined: 12. June 2003 10:46
Location: NRW - Germany

Postby Kai(nen anderer) » 12. June 2003 14:16

Hab den Fehler gefunden (is eigentlich ganz easy)

Ich hab keine relativen Pfade mehr benutzt und die smarty libs in fast jeden Ordner kopiert.. und man siehe: es geht (is geil)
Kai(nen anderer)
 


Return to PHP

Who is online

Users browsing this forum: No registered users and 10 guests