Jump to content


Photo

require() fatal error


  • Please log in to reply
2 replies to this topic

#1 wjwolf79

wjwolf79
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 25 May 2006 - 01:45 PM

I have installed php on a Win2K3 server (IIS6) and it works fine until I try to use include() or require() (doesn't matter which one). I get the following errors:

Warning: require(my_function) [function.require]: failed to open stream: No such file or directory in my_file_path on line 3

Fatal error: require() [function.require]: Failed opening required my_function' (include_path='.;C:\php5\pear') in my_file_path on line 3

I noticed what the second one said about my include path, but that's not what my php.ini says my include path is. Here's my include path directive from my php.ini:
include_path = ".;c:\php\includes"

I've been trying to figure this out for about a week now (I tink a little more than that, actually). I cannot figure it out. I'm using the ISAPI setup, since I cannot get the CGI setup to run at all.

Any assistence would be helpful, as I'm at my wit's end.

#2 wildteen88

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

Posted 25 May 2006 - 02:07 PM

include and require only include files, It doesnt include functions.

This is how you use the functions:
<?php

include 'filename.php';

// OR

require 'filename.php';

?>


#3 wjwolf79

wjwolf79
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 25 May 2006 - 04:35 PM

well duh on that... my mistake typing that. I had the word function in my head because of that function.require line. They are .php files. They work fine on my local pc with IIS5, but not on the server with IIS6.

I have set up php several times on an xp box with IIS5 with no problems both with CGI and ISAPI. IIS6 is very different from IIS5 (thank you, Microsoft), and I cannot get it to recognize any included files (besides putting the file in the same directory as the same file that's trying to include it). Even the phpinfo() function shows that it's thinking my config file is located at C:\Windows (and actually putting it there doesn't solve the problem).




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users