Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Problem mit {include file='bla....

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
nochbr1
Smarty Rookie


Joined: 07 Jan 2013
Posts: 6

PostPosted: Mon Jan 07, 2013 2:20 pm    Post subject: Problem mit {include file='bla.... Reply with quote

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
View user's profile Send private message
TomTo
Smarty Rookie


Joined: 30 May 2009
Posts: 18

PostPosted: Mon Jan 07, 2013 6:43 pm    Post subject: Reply with quote

Ich habe leider gerade nicht soviel Zeit, gebe Dir aber als Stichwort mal den "Safe Mode" mit.
Back to top
View user's profile Send private message
nochbr1
Smarty Rookie


Joined: 07 Jan 2013
Posts: 6

PostPosted: Mon Jan 07, 2013 10:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
nochbr1
Smarty Rookie


Joined: 07 Jan 2013
Posts: 6

PostPosted: Tue Jan 08, 2013 3:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Tue Jan 08, 2013 7:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
nochbr1
Smarty Rookie


Joined: 07 Jan 2013
Posts: 6

PostPosted: Tue Jan 08, 2013 9:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Tue Jan 08, 2013 11:33 pm    Post subject: Reply with quote

'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
View user's profile Send private message
ovnn
Smarty Regular


Joined: 14 Apr 2010
Posts: 82
Location: Germany

PostPosted: Wed Jan 09, 2013 9:11 am    Post subject: Reply with quote

{PHP}

wird auch raus fallen aus smarty. In der 3.x ist es schon deprecated
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP