Jump to content

Archived

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

Ninjakreborn

various problem's with includes

Recommended Posts

I never had this problem before, until now I start using this framework
[code]
<?php
// Master Variables
$docroot = $_SERVER['DOCUMENT_ROOT'];
$contactemail = "businessman332211@hotmail.com";
$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.

Share this post


Link to post
Share on other sites
Top 'n' tail the include file code with php tags

<?php
          // your include code here
?>

Share this post


Link to post
Share on other sites
It is, there are php tag's wrapped around the whole thing.
The config.php in itself is a whole php page, I have the tag's spanning the whole page.

edit- oh you mean on phpfreaks.com yes I had forgotten to do that this time, I just did it.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Yes, all the permission's on it, seem to be set.  I checked the permission's on functions and hte permissions on the specific file security.inc.php
and it's still returning the same error.

Share this post


Link to post
Share on other sites
Maybe the problem is when you use the $docroot cause your output string get like this '//master/config/functions/security.inc.php'. Im not sure just a suggestion

Share this post


Link to post
Share on other sites

×

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.