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

PHP5 & Apache2 crash with Smarty 2.6.2 on Windows

 
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 -> Bugs
View previous topic :: View next topic  
Author Message
andig
Smarty Regular


Joined: 22 Apr 2004
Posts: 48

PostPosted: Thu Apr 22, 2004 2:57 pm    Post subject: PHP5 & Apache2 crash with Smarty 2.6.2 on Windows Reply with quote

I've found that asmarty crashes apache2, probably due to a php issue with the following code (WinXP):

<?php
include './\test.php';
?>

The problem is the filename in the include statement. In my case, the _get_auto_filename function produces a filename like './cache/smarty\list.tpl', as the DIR separator is \

I think that it is a php bug that such a filename leads to a crash, but I'd prefer if smarty could generate better filenames?

Appending / to the smarty config variable does not help, the filename is then './cache/smarty/\list.tpl', which still crashes apache...

Any ideas?

Thanks,
Andi


Cheers,
Andi
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Thu Apr 22, 2004 4:48 pm    Post subject: Reply with quote

When you define your directories, try using the usual windows separators. If you are writing portable scripts, then use DIRECTORY_SEPARATOR (I know it is ugly--but it is safe).

See if you can verify if this is a PHP bug (try it without Smarty) and if so, perhaps report it at http://bugs.php.net.
Back to top
View user's profile Send private message
andig
Smarty Regular


Joined: 22 Apr 2004
Posts: 48

PostPosted: Fri Apr 23, 2004 12:42 pm    Post subject: Reply with quote

I'm pretty sure it's a php bug:

http://bugs.php.net/bug.php?id=28108

but thought the smarty code might work around this. But I think you're right- I should be using DIR_SEP.

Thanks,
Andi
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Fri Apr 23, 2004 8:11 pm    Post subject: Reply with quote

FWIW, DIR_SEP is deprecated, so you should consider using DIRECTORY_SEPARATOR.
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 -> Bugs 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