[PHP] Re: Trouble with include/require

2004-07-16 Thread Daniel Kullik
You should not overwrite the whole include-path. Just append new paths. This should do: [code] // Expand include-path (';' on Windows) $sep = ('WIN' == substr(PHP_OS, 0, 3)) ? ';' : ':'; ini_set('include_path', ini_get('include_path') . $sep . dirname(__FILE__) . 'includes/'); [/code] Daniel A.

Re: [PHP] Re: Trouble with include/require

2004-07-16 Thread A. Lanza
In fact, i'm not changing the include_path in my code, just uncommented the line in php.ini configuration file. Do i have to set include_path in code? Where in code should i put that piece of code setting include_path? Is there any simple way to include files using relative paths from the ones

Re: [PHP] Re: Trouble with include/require

2004-07-16 Thread Daniel Kullik
Does your PHP-interpreter parse .inc files at all? Did you get any error-messages? If not, set your error-reporting level to E_ALL any force PHP to display errors on screen. [code] error_reporting(E_ALL); ini_set('display_errors', true); [/code] Place this code before your include() call. PHP

Re: [PHP] Re: Trouble with include/require

2004-07-16 Thread A. Lanza
Still i cannot place my include files in a directory other than the same as my main scripts... I have scripts in /var/www/html/project/ directory. I would like to put the include files in /var/www/html/project/includes. How should i include them in the main scripts? I've tried the two following

Re: [PHP] Re: Trouble with include/require

2004-07-16 Thread Daniel Kullik
Using chmod 710 on your include-directroy and chmod 640 on your scripts might solve your file-permission problem. A. Lanza wrote: Still i cannot place my include files in a directory other than the same as my main scripts... I have scripts in /var/www/html/project/ directory. I would like to put

Re: [PHP] Re: Trouble with include/require

2004-07-16 Thread Curt Zirzow
* Thus wrote A. Lanza: In fact, i'm not changing the include_path in my code, just uncommented the line in php.ini configuration file. Do i have to set include_path in code? Where in code should i put that piece of code setting include_path? Is there any simple way to include files using

Re: [PHP] Re: Trouble with include/require

2004-07-16 Thread Jason Barnett
That will try and find a file in these locations in order: /var/www/html/projects/include/db.inc ./db.inc /php/includes/db.inc And will use the first one found. I would not suggest using ini_set() inside you're scripts to adjust your paths. Curt Hey Curt, why do you suggest we don't use

Re: [PHP] Re: Trouble with include/require

2004-07-16 Thread raditha dissanayake
Jason Barnett wrote: I would not suggest using ini_set() inside you're scripts to adjust your paths. Hey Curt, why do you suggest we don't use ini_set to adjust paths? I'm using it as part of my library autoloader - it may not be as efficient as changing the path directly but it seems to work

Re: [PHP] Re: Trouble with include/require

2004-07-16 Thread Curt Zirzow
* Thus wrote Jason Barnett: That will try and find a file in these locations in order: /var/www/html/projects/include/db.inc ./db.inc /php/includes/db.inc And will use the first one found. I would not suggest using ini_set() inside you're scripts to adjust your paths. Curt