Problem with include on windows NT server

Closed
Office23 Posts 9 Registration date Thursday February 21, 2008 Status Member Last seen August 22, 2008 - Feb 22, 2008 at 01:39 AM
crazy_phoebe Posts 98 Registration date Wednesday February 20, 2008 Status Member Last seen February 6, 2009 - Jul 6, 2008 at 06:16 AM
Hello,

im on a windows NT server, and somehow, when i use the include methode include('../functions.php');

it doesn't find the functions.php page!!

i have a file name post.php, it's in a folder, and i need to include the functions file to it.. i also tried a relative path which doesn't work either.

Some people told me to try the code below since im on a windows NT server

Code:
include('C:\hshome\host-user\xfzo.com\functions.php')
but i got these warning messages

Warning: main('C:\hshome\host-user\xfzo.com\functions.php') [function.main]: failed to open stream: No such file or directory in 'C:\hshome\host-user\xfzo.com\posts.php'on line 4

Warning: main() [function.include]: Failed opening 'C:\hshome\host-user\xfzo.com\functions.php' for inclusion (include_path='.;c:\php4\pear') in C:\hshome\host-user\xfzo.com\shoutbox\posts.php on line 4

What should i do?
Related:

7 responses

Htmlgirl Posts 12 Registration date Thursday February 21, 2008 Status Member Last seen August 1, 2008 2
Feb 22, 2008 at 03:44 AM
Hello Office23,

You can use the set_include_path or set_require_path. i tried this before..

Visit www.php.net for more information
0
Itboy26 Posts 8 Registration date Thursday February 21, 2008 Status Member Last seen August 20, 2008 1
Feb 22, 2008 at 03:56 AM
Hi office23, welcome to the forum..

You can also make a test.. make two page, one named test1.php and another one name test2.php.

Put test2.php in the root folder and test1.php in a folder called test!

in test1.php just type

<?php
echo "Hello ";
include "test2.php";
?>


in test2.php just type

<?php
echo "World";
?>

Then open test1.php. You should get Hello world on the page
0
Blocked Profile
Feb 22, 2008 at 04:10 AM
office23, you should specify that you are using php as your programming language in your thread title. Otherwise people won't be able to determine if you're talking about it. The warning message you got from php already told you the error.

include_path='.;c:\php4\pear'. <--- that's the actual error

in your php.ini setting, just change it from the location you want to include your file. Hope that makes sense. Try it and tell me if it works.
0
Office23 Posts 9 Registration date Thursday February 21, 2008 Status Member Last seen August 22, 2008
Feb 22, 2008 at 04:18 AM
Hi Htmlgirl, i tried using the set_include_path but i don't really understand it. How should I apply this code in my actual code? It's for a project I'm working on and the deadline is three days.
0

Didn't find the answer you are looking for?

Ask a question
Itboy26 Posts 8 Registration date Thursday February 21, 2008 Status Member Last seen August 20, 2008 1
Feb 22, 2008 at 04:24 AM
According to that error message, you can only include files that are in the same directory(folder) as your script or in c:\php4\pear unless you change it from your php.ini as mentioned by Jamescracker. If you don't have access to php.ini, just ask your host provider to change it or just put the file that you need to include in the same directory. As long as it doesn't affect your script, it's fine.
0
I solved this using the code:

require_once ( $_SERVER['DOCUMENT_ROOT'].'/test.php' );
0
crazy_phoebe Posts 98 Registration date Wednesday February 20, 2008 Status Member Last seen February 6, 2009 2
Jul 6, 2008 at 06:16 AM
hi office 23,i have the same problem and i have solve it by using the ;set_include_path or set_require_path. it really solved the problem automatically.try it and you will be alright;-]
0