Groups > Novell > Novell NetWare with PHP > Re: php include




php include

php include
Fri, 22 Sep 2006 15:13:24 GMT
top_folder/manager

database.php is in top_folder
manager_login.php is in manager folder

That is the line from manager_login.php that does not work:

include( "../database.php" ); // ADD DATABASE CONNECTION FILE

If I move the database.php to same folder as the manger_login.php all starts 
working OK

What do I use for NetWare " folder up", as it seems not to understand
../

Thanks

Seb

Post Reply
Re: php include
Fri, 22 Sep 2006 16:35:35 GMT
Hi Sebastian,

"Sebastian Cerazy" <sebastian.cerazy@(nospam)spgs.org> wrote in
news:o4TQg.2235$0w1.1613@prv-forum2.provo.novell.com: 

> top_folder/manager
> 
> database.php is in top_folder
> manager_login.php is in manager folder
> 
> That is the line from manager_login.php that does not work:
> 
> include( "../database.php" ); // ADD DATABASE CONNECTION FILE
> 
> If I move the database.php to same folder as the manger_login.php all
> starts working OK
> 
> What do I use for NetWare " folder up", as it seems not to
understand
> ../ 
when you develop its a good idea to either:
- loock into sys:/php5/error.log for errors
or:
- set error output from your script with "ini_set('display_errors',
1);"
there you get often some answers.....
your assumption that ../ doesnt work on NetWare is wrong - its just a 
security feature/setting which you find on other platforms too;
the restriction happens most likely with the open_basedir settings in your 
php.ini. Beside that its a bad programming practice to refer to files in 
lower directories in that way; better would be if you set from your first 
level main file a project's root var, and use that later to include the 
files in lower dirs with full path which should work without violating 
security.
The safe_mode setting might result in additional restrictions - I dont know 
for sure....

Guenter.

Post Reply
Re: php include
Sat, 23 Sep 2006 15:26:29 GMT
Well, I do not develop this, it is simply a php script that I want to use on
my server

I can not talk to people that wrote the script, as thay have NO idea what I
am talking about mentioning NetWare. All the php developers know is Linux &
Windoze

Hence I am on my own here (and this NG)

I will check the php.ini & report back

Seb


>>> On 22/09/2006 at 17:35, in message
<rhUQg.2325$0w1.627@prv-forum2.provo.novell.com>,
Guenter<devforums@novell.com> wrote:
> Hi Sebastian,
> 
> "Sebastian Cerazy" <sebastian.cerazy@(nospam)spgs.org>
wrote in
> news:o4TQg.2235$0w1.1613@prv-forum2.provo.novell.com: 
> 
>> top_folder/manager
>> 
>> database.php is in top_folder
>> manager_login.php is in manager folder
>> 
>> That is the line from manager_login.php that does not work:
>> 
>> include( "../database.php" ); // ADD DATABASE CONNECTION
FILE
>> 
>> If I move the database.php to same folder as the manger_login.php all
>> starts working OK
>> 
>> What do I use for NetWare " folder up", as it seems not to
understand
>> ../ 
> when you develop its a good idea to either:
> - loock into sys:/php5/error.log for errors
> or:
> - set error output from your script with "ini_set('display_errors',
1);"
> there you get often some answers.....
> your assumption that ../ doesnt work on NetWare is wrong - its just a 
> security feature/setting which you find on other platforms too;
> the restriction happens most likely with the open_basedir settings in 
> your 
> php.ini. Beside that its a bad programming practice to refer to files in 
> 
> lower directories in that way; better would be if you set from your 
> first 
> level main file a project's root var, and use that later to include the 
> files in lower dirs with full path which should work without violating 
> security.
> The safe_mode setting might result in additional restrictions - I dont 
> know 
> for sure....
> 
Post Reply
Re: php include
Sat, 23 Sep 2006 15:46:21 GMT
OK, changing a couple of entries in php.ini makes it all work.

And whats a great place to look - error.log (never noticed it before)!!

Thanks again for the great directions

I noticed that you said below "..refer to files in lower
directories..."

In fact the script itself exists in lower directory & includes the files in
upper directory (which I think is not that bad)

root_folder/program_folder/admin_manager_folder

The database.php is in program_folder, and the manager_login.php is in
admin_manager_folder

Seb


>>> On 22/09/2006 at 17:35, in message
<rhUQg.2325$0w1.627@prv-forum2.provo.novell.com>,
Guenter<devforums@novell.com> wrote:
> Hi Sebastian,
> 
> "Sebastian Cerazy" <sebastian.cerazy@(nospam)spgs.org>
wrote in
> news:o4TQg.2235$0w1.1613@prv-forum2.provo.novell.com: 
> 
>> top_folder/manager
>> 
>> database.php is in top_folder
>> manager_login.php is in manager folder
>> 
>> That is the line from manager_login.php that does not work:
>> 
>> include( "../database.php" ); // ADD DATABASE CONNECTION
FILE
>> 
>> If I move the database.php to same folder as the manger_login.php all
>> starts working OK
>> 
>> What do I use for NetWare " folder up", as it seems not to
understand
>> ../ 
> when you develop its a good idea to either:
> - loock into sys:/php5/error.log for errors
> or:
> - set error output from your script with "ini_set('display_errors',
1);"
> there you get often some answers.....
> your assumption that ../ doesnt work on NetWare is wrong - its just a 
> security feature/setting which you find on other platforms too;
> the restriction happens most likely with the open_basedir settings in 
> your 
> php.ini. Beside that its a bad programming practice to refer to files in 
> 
> lower directories in that way; better would be if you set from your 
> first 
> level main file a project's root var, and use that later to include the 
> files in lower dirs with full path which should work without violating 
> security.
> The safe_mode setting might result in additional restrictions - I dont 
> know 
> for sure....
> 
Post Reply
about | contact