Re: [PHP] include hassle

2002-08-02 Thread Reuben D. Budiardja

On Friday 02 August 2002 10:41 am, lallous wrote:
> I mean this:
>
> i have this tree:
>
> ./libs/*.php
> ./user/file1.php
>
> now i'm in ./user/ directory
> i run file1.php
> it includes ../libs/lib1.php which in turn will include helper.php
> (./users/helper.php) <-- will fail!
>
> how can i programmatically set the include path?
>
> Elias
>
- You can use an absolute path. 
- You can also specified all the includes path that will be find by php 
automatically in your php.ini. You might want to specify your /libs directory 
there, if you're including a lot of files from that directory.
Either or both should work

Rdb

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] include hassle

2002-08-02 Thread CC Zona

In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Lallous) wrote:

> how can i programmatically set the include path?

http://php.net/ini-set

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] include hassle

2002-08-02 Thread lallous

I mean this:

i have this tree:

./libs/*.php
./user/file1.php

now i'm in ./user/ directory
i run file1.php
it includes ../libs/lib1.php which in turn will include helper.php
(./users/helper.php) <-- will fail!

how can i programmatically set the include path?

Elias

"Reuben D. Budiardja" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Friday 02 August 2002 10:02 am, lallous wrote:
> I have this:
> //file1.php
>  include('../libs/lib1.php');
> ?>
> now lib1.php:
>  include ('helper.php');
> ?>
> If i run file1.php ->includes lib1.php -> fails to include helper.php ! !
> how can i solve that?

We need more information that this. What's the error message? what do you
mean
fails?
In anycase, you should be able to run lib1.php first without error, before
trying file1.php. If the former causes error, resolve that first.

rdb



>
> p.s: currently, i'm chdir()ing to the ../libs path, then i return to
> current dir...
> my code cannot make use of Apache's help. (like setting the include path
> inside .htaccess)
>
> thank you,
> Elias




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] include hassle

2002-08-02 Thread Reuben D. Budiardja

On Friday 02 August 2002 10:02 am, lallous wrote:
> I have this:
> //file1.php
>  include('../libs/lib1.php');
> ?>
> now lib1.php:
>  include ('helper.php');
> ?>
> If i run file1.php ->includes lib1.php -> fails to include helper.php ! !
> how can i solve that?

We need more information that this. What's the error message? what do you mean 
fails?
In anycase, you should be able to run lib1.php first without error, before 
trying file1.php. If the former causes error, resolve that first.

rdb



>
> p.s: currently, i'm chdir()ing to the ../libs path, then i return to
> current dir...
> my code cannot make use of Apache's help. (like setting the include path
> inside .htaccess)
>
> thank you,
> Elias


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php