Re: The Include Eludes

From: Date: Mon, 27 Nov 2000 13:38:21 +0000
Subject: Re: The Include Eludes
References: 1  Groups: php.general php.general 
Request: Send a blank email to php-general+get-27364@lists.php.net to get a copy of this message
Joseph: > my problem is that no matter what I set my include path to in php.ini > php scripts cannot find the files The include_path doesn't need to be set in your php.ini. What may be tripping you up is trying to include files from the wrong directories. Note, all directory requests are relative to the INITIAL PHP script called. So, you'll have to call things like this: -------------- <?php # This file is /htdocs/someone/subdir/home.php include("../head.inc"); echo "That's it"; ?> -------------- <?php # This file is /htdocs/someone/head.inc # Note, "subhead.inc" is in the same dir as this file. # BUT that doesn't matter. # What matters is it's up one dir from "home.php." include("../subhead.inc"); echo "<title>Blah Co</title>"; ?> -------------- <?php # This file is /htdocs/someone/subhead.inc echo "<h1>Blah Co</h1>"; ?> If that's not solving things for you, the problem could be file permissions. Good luck, --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Ave, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409

« previous php.general (#27364) next »