View previous topic :: View next topic |
Author |
Message |
nochbr1 Smarty Rookie
Joined: 07 Jan 2013 Posts: 6
|
Posted: Mon Jan 07, 2013 2:20 pm Post subject: Problem mit {include file='bla.... |
|
|
Hallo,
ich hab da ein kleines Problem mit der include Funktion. (Ich erstelle eine PDF-Datei mit html2pdf)
Erst mal was funktioniert:
Code: | {php}
include ('../../test/159/file.html')
{/php} |
So kann ich einen Absatz in die PDF einfügen.
Versuche ich es so:
Code: |
{include file='../../test/159/file.html'}
|
Geht da gar nichts. (Dateiendungen .tpl .dat .php usw. auch schon probiert)
In den Logfiles steht folgendes:
07.01.2013 14:14 --------------------------------
Warning: is_readable() [<a href='function.is-readable'>function.is-readable</a>]: open_basedir restriction in effect. File(/usr/share/pear/plugins/compiler.page.php) is not within the allowed path(s): (/bla/www/blabla/html/:/bla/www/blabla/phptmp/:/bla/www/blabla/files/:/bla/www/blabla/atd/:/usr/share/php/), /bla/www/blabla/html/test/includes/smarty/internals/core.get_include_path.php @ 34
Warning: is_readable() [<a href='function.is-readable'>function.is-readable</a>]: open_basedir restriction in effect. File(/usr/share/pear/plugins/block.page.php) is not within the allowed path(s): (/bla/www/blabla/html/:/bla/www/blabla/phptmp/:/bla/www/blabla/files/:/bla/www/blabla/atd/:/usr/share/php/), /bla/www/blabla/html/test/includes/smarty/internals/core.get_include_path.php @ 34
Warning: is_readable() [<a href='function.is-readable'>function.is-readable</a>]: open_basedir restriction in effect. File(/usr/share/pear/plugins/function.page.php) is not within the allowed path(s): (/bla/www/blabla/html/:/bla/www/blabla/phptmp/:/bla/www/blabla/files/:/bla/www/blabla/atd/:/usr/share/php/), /bla/www/blabla/html/test/includes/smarty/internals/core.get_include_path.php @ 34
User error: Smarty error: [in text:TT_loeschen_pdf2 line 1]: syntax error: unrecognized tag 'page' (Smarty_Compiler.class.php, line 581), /bla/www/blabla/html/test/includes/smarty/Smarty.class.php @ 1092
Warning: is_readable() [<a href='function.is-readable'>function.is-readable</a>]: open_basedir restriction in effect. File(/usr/share/pear/plugins/compiler./page.php) is not within the allowed path(s): (/bla/www/blabla/html/:/bla/www/blabla/phptmp/:/bla/www/blabla/files/:/bla/www/blabla/atd/:/usr/share/php/), /bla/www/blabla/html/test/includes/smarty/internals/core.get_include_path.php @ 34
Warning: is_readable() [<a href='function.is-readable'>function.is-readable</a>]: open_basedir restriction in effect. File(/usr/share/pear/plugins/function./page.php) is not within the allowed path(s): (/bla/www/blabla/html/:/bla/www/blabla/phptmp/:/bla/www/blabla/files/:/bla/www/blabla/atd/:/usr/share/php/), /bla/www/blabla/html/test/includes/smarty/internals/core.get_include_path.php @ 34
User error: Smarty error: [in text:TT_loeschen_pdf2 line 5]: syntax error: unrecognized tag '/page' (Smarty_Compiler.class.php, line 581), /bla/www/blabla/html/test/includes/smarty/Smarty.class.php @ 1092
Warning: is_readable() [<a href='function.is-readable'>function.is-readable</a>]: open_basedir restriction in effect. File(/usr/share/php/templates/../../test/files/159/veranstalter.html) is not within the allowed path(s): (/bla/www/blabla/html/:/bla/www/blabla/phptmp/:/bla/www/blabla/files/:/bla/www/blabla/atd/:/usr/share/php/), /bla/www/blabla/html/test/includes/smarty/internals/core.get_include_path.php @ 34
Warning: is_readable() [<a href='function.is-readable'>function.is-readable</a>]: open_basedir restriction in effect. File(/usr/share/pear/templates/../../test/files/159/veranstalter.html) is not within the allowed path(s): (/bla/www/blabla/html/:/bla/www/blabla/phptmp/:/bla/www/blabla/files/:/bla/www/blabla/atd/:/usr/share/php/), /bla/www/blabla/html/test/includes/smarty/internals/core.get_include_path.php @ 34
User warning: Smarty error: unable to read resource: "../../test/files/159/veranstalter.html", /bla/www/blabla/html/test/includes/smarty/Smarty.class.php @ 1092
Was ich nicht verstehe ist, warum die Datei nicht gefunden wird? (unable to read = nicht gefunden?)
Ich hab die Datei auch schon mit vollem http://www.blabla.... eingegeben, wird trotzdem nicht gefunden.
Was bedeutet "is not within the allowed path"? Was muss ich da tun?
Ist bestimmt nur eine Kleinigkeit, aber ich brauche ne kleine "Anfängerhilfe" wo ich den Hebel ansetzen muss.
Gruß Achim |
|
Back to top |
|
TomTo Smarty Rookie
Joined: 30 May 2009 Posts: 18
|
Posted: Mon Jan 07, 2013 6:43 pm Post subject: |
|
|
Ich habe leider gerade nicht soviel Zeit, gebe Dir aber als Stichwort mal den "Safe Mode" mit. |
|
Back to top |
|
nochbr1 Smarty Rookie
Joined: 07 Jan 2013 Posts: 6
|
Posted: Mon Jan 07, 2013 10:22 pm Post subject: |
|
|
safe_mode = Off
safe_mode_exec_dir = no value
safe_mode_gid = Off
safe_mode_include_dir = /usr/share/php/
open_basedir steht "/bla/www/blabla/html/:" drin.
Ich hab doch alles in "/bla/www/blabla/html/:" drin. Dieses Verzeichnis ist mein Root-Verzeichnis auf dem Server, müsste dann doch alles erlaubt sein, oder?
Bin völlig verwirrt... |
|
Back to top |
|
nochbr1 Smarty Rookie
Joined: 07 Jan 2013 Posts: 6
|
Posted: Tue Jan 08, 2013 3:15 pm Post subject: |
|
|
Eine Lösung habe ich schon mal gefunden.
So geht's:
Code: | {include file="/bla/www/blabla/html/test/files/`$event_id`/veranstalter.html"}
|
(ich habe da noch eine zusätzliche Variable im Code)
Jetzt suche ich nur noch nach der Erklärung, warum ich den Pfad so eintragen muss.
Gruß |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Jan 08, 2013 7:22 pm Post subject: |
|
|
In PHP Code: | {php}
include ('../../test/159/file.html')
{/php} | ist der Pfad relativ zum PHP script.
Im Template Code: | {include file='../../test/159/file.html'} | ist der Pfad relative zu dem Wert von $smarty->template_dir |
|
Back to top |
|
nochbr1 Smarty Rookie
Joined: 07 Jan 2013 Posts: 6
|
Posted: Tue Jan 08, 2013 9:46 pm Post subject: |
|
|
Da hab ich noch ne Frage:
Code: | class Smarty
{
/**#@+
* Smarty Configuration Section
*/
/**
* The name of the directory where templates are located.
*
* @var string
*/
var $template_dir = 'templates';
|
Ein Auszug aus der Smarty.class.php.
Ist es denn richtig, dass dort "templates" als Template Verzeichnis konfiguriert ist?
Ich finde bei mir nur ein "template" Verzeichnis (ohne "s")
Noch mal ne andere Frage:
Code: | http://www.blablabla.de/test/files |
und
Code: | /bla/www/blabla/html/test/files |
ist doch beides mal ein absolut angegebener Pfad, der auf das gleiche Verzeichnis verweist. Warum geht die 2. Angabe und die erste nicht?
Gruß Achim |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Jan 08, 2013 11:33 pm Post subject: |
|
|
'templates' ist das von Smarty verwendete Default-Verzeichnis. Wenn auf Deinem System ein anderes Verzeichnis angelegt ist ist dies ein Fehler oder Du müsstest $smarty->template_dir mit dem tatsächlichen Verzeichnisnamen umdefinieren.
'http://www.blablabla.de/test/files' ist eine URL aus Sicht des Internets und kein Dateipfad des Dateisystems. |
|
Back to top |
|
ovnn Smarty Regular
Joined: 14 Apr 2010 Posts: 82 Location: Germany
|
Posted: Wed Jan 09, 2013 9:11 am Post subject: |
|
|
{PHP}
wird auch raus fallen aus smarty. In der 3.x ist es schon deprecated |
|
Back to top |
|
|