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 ways,

1.
include 'includes/file.inc';

2.
ini_set('include_path', './includes');
include 'file.inc';

but neither of them have worked.

Any help?

On Fri, 2004-07-16 at 11:30, Daniel Kullik wrote:
> 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 should print out an error-message if it fails to include a file.
> 
> 
> A. Lanza wrote:
> 
> > 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 where main scripts are?
> > 
> > I have /var/www/html/project, where i put my scripts. includes directory
> > is under that path. I want to put all my include files in there. I
> > guessed that including files like this, include 'includes/db.inc', would
> > work, since include_path is set to "." in php.ini, but it does not.
> > 
> > Any help?
> > 
> > On Fri, 2004-07-16 at 10:35, Daniel Kullik wrote:
> > 
> >>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. Lanza wrote:
> >>
> >>
> >>>Hi list,
> >>>
> >>>i'm trying to include files in my php scripts but things seem not to
> >>>work properly. In my script, i include a file like this:
> >>>
> >>><?php include 'includes/db.inc' ?>
> >>>
> >>>I have all include files in includes directory, that's a children of the
> >>>directory where my scrips are. The include_path config. variable is set
> >>>like this:
> >>>
> >>>include_path = ".:/php/includes"
> >>>(i have uncommented that line)
> >>>
> >>>PHP does not include my files. What i am doing wrong?
> >>>
> >>>Thanks
> >>>
> >>>AL
> >>
> >>
> >>-- 
> >>WWE e-commerce IT GmbH
> >>Eiffestrasse 462, D-20537 Hamburg
> >>Tel.: +49-40-2530659-0, Fax: +49-40-2530659-50
> 
> 
> -- 
> WWE e-commerce IT GmbH
> Eiffestrasse 462, D-20537 Hamburg
> Tel.: +49-40-2530659-0, Fax: +49-40-2530659-50

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

Reply via email to