View previous topic :: View next topic |
Author |
Message |
SOL Smarty n00b
Joined: 26 May 2003 Posts: 2
|
Posted: Mon May 26, 2003 12:08 pm Post subject: PHP Error in Smarty.class.php on line 2691 |
|
|
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!!
Can someone help me please? |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
|
Back to top |
|
SOL Smarty n00b
Joined: 26 May 2003 Posts: 2
|
Posted: Wed May 28, 2003 9:55 am Post subject: |
|
|
Yes I know, but use_sub_dirs IS set to false! |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Wed May 28, 2003 1:39 pm Post subject: |
|
|
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 |
|
mniskanen Smarty Rookie
Joined: 26 Apr 2003 Posts: 20 Location: Lieksa,Finland
|
Posted: Fri Oct 03, 2003 3:03 pm Post subject: |
|
|
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 |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Fri Oct 03, 2003 3:53 pm Post subject: |
|
|
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 |
|
mniskanen Smarty Rookie
Joined: 26 Apr 2003 Posts: 20 Location: Lieksa,Finland
|
Posted: Sat Oct 04, 2003 12:56 pm Post subject: |
|
|
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 |
|
|