Jump to content

various problem's with includes


Ninjakreborn

Recommended Posts

I never had this problem before, until now I start using this framework
[code]
<?php
// Master Variables
$docroot = $_SERVER['DOCUMENT_ROOT'];
$contactemail = "[email protected]";
$elevel = 1; // level of error function (either 0 for off, 1 for on)
$dbactive = "yes"; // either yes or no
$dbhost = "localhost"; // Normally local host
$dbusername = "#####";
$dbpassword = "####";
$db = "#####";

// connection information
if ($dbactive = "yes") { // if yes perform db work
mysql_connect($dbhost, $dbusername, $dbpassword);
mysql_select_db($db);
}

// Handling php security issues
require_once($docroot . '/master/config/functions/security.inc.php'); // security include
error($elevel); // function to set error level, defaulted to all and strict.
?>
[/code]
Ok for the security include, it's not including.

It's returning
[quote]Fatal error: main() [function.require]: Failed opening required '/homepages/30/d162063315/htdocs/master/config/functions/security.inc.php' (include_path='.:/usr/local/lib/php') in /homepages/30/d162063315/htdocs/oakley/master/config/config.php on line 29[/quote]
The thing I don't get, is I have alway's noticed in php.ini something called include path.
Normally it requires a ./ before each include.  this one say's something like .: but that doesn't work either.
Is there a way to override that setting manually, all the time, it ALWAY"S causes problem's or atleast it's going to.  I have to already manually include the config file into every page on the server.
Link to comment
https://forums.phpfreaks.com/topic/25506-various-problems-with-includes/
Share on other sites

The include_path directive has nothing to do with it. The [b].:[/b] tells PHP to use a the current directory. However the colon is a separator. I suggest you read up on what's the include_path is for

PHP is finding the file security.inc.php however from the error it is having trouble opening this file, most probably due to the permissions are set too low so PHP is not being allowed access to this file from the OS. Make sure security.inc.php CHMOD permissions is set to 644

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.