|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
dondi Smarty n00b
Joined: 28 Aug 2003 Posts: 2
|
Posted: Thu Aug 28, 2003 9:30 pm Post subject: Problem with open_basedir restriction or include_path |
|
|
I'm having difficulty getting Smarty to do it's thing. I've gone through the documentation and searched the smarty forum and could not solve this.
I have Smarty libs installed at '/home/dondi/lib/php/Smarty'.
I have template_dir, compile_dir, config_dir, and cache_dir placed at '/home/dondi/smarty/hello'. These dirs are insecurely chmod'd 777.
In my doc root, I have index.php:
[php:1:d921ab7adc]
<?php
define('SMARTY_DIR','/home/dondi/lib/php/Smarty/');
require(SMARTY_DIR.'Smarty.class.php');
$smarty = new Smarty;
$smarty->template_dir = '/home/dondi/smarty/hello/templates';
$smarty->compile_dir = '/home/dondi/smarty/hello/templates_c';
$smarty->config_dir = '/home/dondi/smarty/hello/configs';
$smarty->cache_dir = '/home/dondi/smarty/hello/cache';
$smarty->assign('name','dondi');
$smarty->display('index.tpl');
?>
[/php:1:d921ab7adc]
My '/home/dondi/smarty/hello/templates/index.tpl' looks like:
Code: |
{* Smarty *}
Hello, {$name}!
|
When I point my browser to this page I get:
Warning: open_basedir restriction in effect. File is in wrong directory in /home/dondi/lib/php/Smarty/Smarty.class.php on line 1195
Warning: open_basedir restriction in effect. File is in wrong directory in /home/dondi/lib/php/Smarty/core/core.create_dir_structure.php on line 18
Warning: open_basedir restriction in effect. File is in wrong directory in /home/dondi/lib/php/Smarty/core/core.create_dir_structure.php on line 68
Warning: open_basedir restriction in effect. File is in wrong directory in /home/dondi/lib/php/Smarty/core/core.create_dir_structure.php on line 68
Warning: Smarty error: problem creating directory '/home/dondi/smarty/hello/templates_c/_smarty_cached_paths' in /home/dondi/lib/php/Smarty/Smarty.class.php on line 1156
Warning: Smarty error: problem writing temporary file '/home/dondi/smarty/hello/templates_c/_smarty_cached_paths/3f4e6ae64eb1f' in /home/dondi/lib/php/Smarty/Smarty.class.php on line 1156
Warning: open_basedir restriction in effect. File is in wrong directory in /home/dondi/lib/php/Smarty/core/core.write_compiled_resource.php on line 31
Warning: open_basedir restriction in effect. File is in wrong directory in /home/dondi/lib/php/Smarty/Smarty.class.php on line 1472
Warning: open_basedir restriction in effect. File is in wrong directory in /home/dondi/lib/php/Smarty/core/core.create_dir_structure.php on line 18
Warning: open_basedir restriction in effect. File is in wrong directory in /home/dondi/lib/php/Smarty/core/core.create_dir_structure.php on line 68
Warning: open_basedir restriction in effect. File is in wrong directory in /home/dondi/lib/php/Smarty/core/core.create_dir_structure.php on line 68
Warning: Smarty error: problem creating directory '/home/dondi/smarty/hello/templates_c/%%117' in /home/dondi/lib/php/Smarty/Smarty.class.php on line 1156
Warning: Smarty error: problem writing temporary file '/home/dondi/smarty/hello/templates_c/%%117/%%1172603085/3f4e6ae658765' in /home/dondi/lib/php/Smarty/Smarty.class.php on line 1156
Warning: open_basedir restriction in effect. File is in wrong directory in /home/dondi/lib/php/Smarty/core/core.write_compiled_resource.php on line 31
Warning: open_basedir restriction in effect. File is in wrong directory in /home/dondi/lib/php/Smarty/Smarty.class.php on line 1323
Warning: Failed opening '/home/dondi/smarty/hello/templates_c/%%117/%%1172603085/index.tpl.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/dondi/lib/php/Smarty/Smarty.class.php on line 1323
My PHP version is 4.2.3. '/home/dondi' is included in open_basedir. safe_mode is Off.
I've tried this setup with 2.5.0 and 2.6.0RC1 to no avail.
What am I doing wrong here? Any suggestions? |
|
Back to top |
|
dondi Smarty n00b
Joined: 28 Aug 2003 Posts: 2
|
Posted: Thu Aug 28, 2003 11:37 pm Post subject: Well I learned something |
|
|
As it turns out '/home/dondi' is a symbolic link to '/home/members/dondi'. Once I corrected the previously mention paths to be more absolute. Everything works now. I guess Smarty does not follow (shortcuts|aliases|symbolic links). |
|
Back to top |
|
|
|
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
|