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