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

PHP Error in Smarty.class.php on line 2691

 
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 -> Installation and Setup
View previous topic :: View next topic  
Author Message
SOL
Smarty n00b


Joined: 26 May 2003
Posts: 2

PostPosted: Mon May 26, 2003 12:08 pm    Post subject: PHP Error in Smarty.class.php on line 2691 Reply with quote

Hi

I've a big problem! I use smarty 2.5.0 on Windows 2000 with Apache 1.3.27 and PHP 4.3.1. When I turn safe_mode on, then the following errors occur:

Quote:
Warning: file_exists() [function.file-exists]: Unable to access .\plugins\compiler.assign.php in C:\PHP\includes\Smarty.class.php on line 2691

Warning: file_exists() [function.file-exists]: Unable to access .\plugins\block.assign.php in C:\PHP\includes\Smarty.class.php on line 2691

Warning: file_exists() [function.file-exists]: Unable to access .\plugins\compiler.assign.php in C:\PHP\includes\Smarty.class.php on line 2691

Warning: file_exists() [function.file-exists]: Unable to access .\plugins\block.assign.php in C:\PHP\includes\Smarty.class.php on line 2691

Warning: file_exists() [function.file-exists]: Unable to access .\plugins\compiler.math.php in C:\PHP\includes\Smarty.class.php on line 2691

Warning: file_exists() [function.file-exists]: Unable to access .\plugins\block.math.php in C:\PHP\includes\Smarty.class.php on line 2691


When safe_mode is off, all works fine! The funny thing about it is that these files (compiler.assign.php, block.assign.php, ...) don't exist in the plugin directory!! Shocked

Can someone help me please? Sad
Back to top
View user's profile Send private message Visit poster's website
boots
Administrator


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

PostPosted: Mon May 26, 2003 9:42 pm    Post subject: Reply with quote

http://www.phpinsider.com/smarty-forum/viewtopic.php?t=134
Back to top
View user's profile Send private message
SOL
Smarty n00b


Joined: 26 May 2003
Posts: 2

PostPosted: Wed May 28, 2003 9:55 am    Post subject: Reply with quote

Yes I know, but use_sub_dirs IS set to false! Sad
Back to top
View user's profile Send private message Visit poster's website
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Wed May 28, 2003 1:39 pm    Post subject: Reply with quote

can you access files that actually *are* in the plugins-directory?

the files you mention are tested for existence, due to the priority plugins have. compiler-plugins have highest priorit, then come block-plugins, then function-plugins. so if smarty encounters {assign} it first looks for a compiler.assign.php, then it looks for a block.assign.php then it looks for function.assign.php (all this in *all* plugin-directories and in php's include_path).

if you turn safe-mode on, ensure that all directories in your php-include_path and in your $smarty->plugins_dir are allowed to be accessed by php, or lower your error_reporting.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mniskanen
Smarty Rookie


Joined: 26 Apr 2003
Posts: 20
Location: Lieksa,Finland

PostPosted: Fri Oct 03, 2003 3:03 pm    Post subject: Reply with quote

messju wrote:
if you turn safe-mode on, ensure that all directories in your php-include_path and in your $smarty->plugins_dir are allowed to be accessed by php, or lower your error_reporting.


Since Smarty 2.5.0 I have run to the include_path problem a couple of time
and this seems to occur when there is a template to be compiled and this
error on line 2691 jumps to my face. I have had no problems with the
previous versions (same server, same settings).

The problem is that for some reason the compiler (or whoever) tries to
find a file from the whole include_path, I do not remember which one but it
tries to open it at /usr/local/lib which is forbidden by safe_mode.

The solution was simple: I created a .htaccess file something like this:

Code:
php_value include_path .:/home/customers/me/public_html/thisapp


so PHP's original (in my opinion moronic) include_path is overridden. The
funny thing is that this was not needed before 2.5.0. Has something changed?

Markku
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Fri Oct 03, 2003 3:53 pm    Post subject: Reply with quote

your fix (making the include_file_path only contain files that are valid against open_basedir- and safe_mode-restrictions) is the right way to go IMHO. the error is triggered by a buggy configuration-setting so i don't see this as a bug in smarty.

to my knowledge there was no change in the plugin-file-handling from 2.4.2 to 2.5.0. i don't know why this doesn't occur with older versions, as you say. *shrug*
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mniskanen
Smarty Rookie


Joined: 26 Apr 2003
Posts: 20
Location: Lieksa,Finland

PostPosted: Sat Oct 04, 2003 12:56 pm    Post subject: Reply with quote

messju wrote:

to my knowledge there was no change in the plugin-file-handling from 2.4.2 to 2.5.0. i don't know why this doesn't occur with older versions, as you say. *shrug*


It might have something to do with th PHP version as well, I have
double-checked everything. The code around line 2691 looks exactly the
same to me as well. Well, not a big problem, the .htaccess works just
perfectly.

This is just about the ounly trouble I have hade for the 18 months I have
been using Smarty.
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 -> Installation and Setup 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