View previous topic :: View next topic |
Author |
Message |
DJ-Smooth Smarty Rookie
Joined: 03 Apr 2004 Posts: 9
|
Posted: Sat Apr 03, 2004 11:02 am Post subject: Warning: file_exists() |
|
|
Hello.
First i wanna say that my english is not very good.
i've been programming a lot with smarty on my localhost.
now i have putted the files on an internet account. result: many errors!
most of them i have solved. but this warning i can't get it away:
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(../plugins/compiler.assign_debug_info.php) is not within the allowed path(s): (/www/htdocs/ogm/) in /www/htdocs/ogm/smarty/core/core.get_include_path.php on line 34
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(../plugins/block.assign_debug_info.php) is not within the allowed path(s): (/www/htdocs/ogm/) in /www/htdocs/ogm/smarty/core/core.get_include_path.php on line 34
any ideas?
everything else seems to be ok.
display and assingment work very well!
greets tim |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Sat Apr 03, 2004 1:37 pm Post subject: |
|
|
it seems you have directories in your include_path that you are not allowed to access.
change your include_path so it only has elements that are allowed by your open_basedir settings.
see: http://php.net/manual/en/configuration.php |
|
Back to top |
|
DJ-Smooth Smarty Rookie
Joined: 03 Apr 2004 Posts: 9
|
Posted: Sat Apr 03, 2004 4:35 pm Post subject: |
|
|
hmm. how do you edit the php.ini from a webspace hoster like allinkl.
everything is parsed well.any other ideas?
is this file needed?
can i export the core directory?
thats the setting from allinkl.de
open_basedir | /www/htdocs/ogm/:/tmp:/usr/bin:/www/htdocs/ogm:/bin:/usr/local/bin | no value
/index.php
/smarty/smarty.class.php
/smarty/core
.
.
.
index.php uses a class called "main" which extends smarty... don't know what to do...
(whats your icq number? @messju?) |
|
Back to top |
|
electr0`n Guest
|
Posted: Sat Apr 03, 2004 5:20 pm Post subject: |
|
|
In most cases you can't edit the php.ini from your hoster. Please check if your folders (compile_dir, template_dir) are in the open_basedir. |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Sat Apr 03, 2004 6:04 pm Post subject: |
|
|
if you don't have access to php.ini or httpd.conf, many things can be set in the php-file via ini_set(). |
|
Back to top |
|
DJ-Smooth Smarty Rookie
Joined: 03 Apr 2004 Posts: 9
|
Posted: Sun Apr 04, 2004 8:40 am Post subject: |
|
|
http://www.phpinsider.com/smarty-forum/viewtopic.php?t=1663
thats someone who has the same problem like me.
working not within the root dir no problems.
working in the root dir. -> function file exists()
Code: | echo ini_get("open_basedir");
echo "<br>";
echo ini_set("open_basedir", "/www/ogm/htdocs/smarty/:/www/ogm/htdocs/smarty/core/:/www/ogm/htdocs/smarty/plugins/:/www/htdocs/ogm/:/tmp:/usr/bin:/www/htdocs/ogm:/bin:/usr/local/bin");
echo ini_get("open_basedir"); |
result:
/www/htdocs/ogm/:/tmp:/usr/bin:/www/htdocs/ogm:/bin:/usr/local/bin
/www/htdocs/ogm/:/tmp:/usr/bin:/www/htdocs/ogm:/bin:/usr/local/bin
is the ini_set for open_basedir not correct?
thx |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Sun Apr 04, 2004 9:37 am Post subject: |
|
|
DJ-Smooth wrote: | is the ini_set for open_basedir not correct? |
that depends on your include_path.
and BTW you cannot modify open_basedir via ini_set().
i don't see what's so hard about it:
you have
/www/htdocs/ogm/:/tmp:/usr/bin:/www/htdocs/ogm:/bin:/usr/local/bin
your cwd is maybe /www/htdocs/ogm
your include-path is ".:.."
smarty looks in
- SMARTY_DIR . plugins
- plugins
- ./plugins
- ../plugins
bang - the ".." moves out of the list of allowed dirs. |
|
Back to top |
|
DJ-Smooth Smarty Rookie
Joined: 03 Apr 2004 Posts: 9
|
Posted: Sun Apr 04, 2004 12:26 pm Post subject: |
|
|
sorry i'm a noob how to do this? |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Sun Apr 04, 2004 12:35 pm Post subject: |
|
|
ini_set('include_path', '.:/www/htdocs/ogm');
maybe
also: it's best to use full-paths for plugins_dirs, template_dir, compile_dir etc. |
|
Back to top |
|
DJ-Smooth Smarty Rookie
Joined: 03 Apr 2004 Posts: 9
|
Posted: Sun Apr 04, 2004 12:57 pm Post subject: |
|
|
works fine.thx a lot |
|
Back to top |
|
|