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

Warning: file_exists()

 
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 -> General
View previous topic :: View next topic  
Author Message
DJ-Smooth
Smarty Rookie


Joined: 03 Apr 2004
Posts: 9

PostPosted: Sat Apr 03, 2004 11:02 am    Post subject: Warning: file_exists() Reply with quote

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
View user's profile Send private message
messju
Administrator


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

PostPosted: Sat Apr 03, 2004 1:37 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
DJ-Smooth
Smarty Rookie


Joined: 03 Apr 2004
Posts: 9

PostPosted: Sat Apr 03, 2004 4:35 pm    Post subject: Reply with quote

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
View user's profile Send private message
electr0`n
Guest





PostPosted: Sat Apr 03, 2004 5:20 pm    Post subject: Reply with quote

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

PostPosted: Sat Apr 03, 2004 6:04 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
DJ-Smooth
Smarty Rookie


Joined: 03 Apr 2004
Posts: 9

PostPosted: Sun Apr 04, 2004 8:40 am    Post subject: Reply with quote

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
View user's profile Send private message
messju
Administrator


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

PostPosted: Sun Apr 04, 2004 9:37 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
DJ-Smooth
Smarty Rookie


Joined: 03 Apr 2004
Posts: 9

PostPosted: Sun Apr 04, 2004 12:26 pm    Post subject: Reply with quote

sorry i'm a noob how to do this?
Back to top
View user's profile Send private message
messju
Administrator


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

PostPosted: Sun Apr 04, 2004 12:35 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
DJ-Smooth
Smarty Rookie


Joined: 03 Apr 2004
Posts: 9

PostPosted: Sun Apr 04, 2004 12:57 pm    Post subject: Reply with quote

works fine.thx a lot
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 -> General 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