Jump to content


Photo

various problem's with includes


  • Please log in to reply
6 replies to this topic

#1 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 29 October 2006 - 06:15 PM

I never had this problem before, until now I start using this framework
<?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.
?>
Ok for the security include, it's not including.

It's returning

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

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.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 29 October 2006 - 06:20 PM

Top 'n' tail the include file code with php tags

<?php
          // your include code here
?>
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#3 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 29 October 2006 - 06:22 PM

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.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 29 October 2006 - 06:23 PM

The include_path directive has nothing to do with it. The .: 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

#5 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 29 October 2006 - 06:26 PM

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.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#6 ponsho

ponsho
  • Members
  • PipPip
  • Member
  • 24 posts

Posted 29 October 2006 - 06:40 PM

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

#7 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 29 October 2006 - 06:54 PM

That still didn't fix it, I am very confused in this situation, anyone else?

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users