rss
Search : in
By : Relevance Date Username
Statut : Not resolved

Problem with include on windows NT server

Posté par Office23, le Friday February 22, 2008 06:39:10 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?
Configuration: Windows XP
Internet Explorer 6.0
Reply to Office23  Report this message to moderators Go to last message

1


  • This message seems useful, vote!
  • Report this message to moderators
Htmlgirl, on Friday February 22, 2008 08:44:32 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
Reply to Htmlgirl

2


  • This message seems useful, vote!
  • Report this message to moderators
Itboy26, on Friday February 22, 2008 08:56:28 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
Reply to Itboy26

3


  • This message seems useful, vote!
  • Report this message to moderators
Jamescracker, on Friday February 22, 2008 09:10:43 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.
Reply to Jamescracker

4


  • This message seems useful, vote!
  • Report this message to moderators
Office23, on Friday February 22, 2008 09:18:28 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.
Reply to Office23

5


  • This message seems useful, vote!
  • Report this message to moderators
Itboy26, on Friday February 22, 2008 09:24:33 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.
Reply to Itboy26

6


  • This message seems useful, vote!
  • Report this message to moderators
nonamer, on Tuesday March 25, 2008 03:35:03 PM
I solved this using the code:

require_once ( $_SERVER['DOCUMENT_ROOT'].'/test.php' );
Reply to nonamer

7


  • This message seems useful, vote!
  • Report this message to moderators
 crazy_phoebe, on Sunday July 6, 2008 11:16:33 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;-]
Reply to crazy_phoebe
Software found in the relevant downloads
Download  Avira AntiVir Personal free for Windows 8.1.0.326 Avira AntiVir Personal free for Windows - Avira AntiVir PersonalEdition Classic is a very good and free antivirus which reliably protects your private computer...Category: Antivirus
License: Freeware/gratuit
Download Windows Live Messenger  8.1.0178Windows Live Messenger - Windows Live Messenger is the next-generation MSN Messenger. It has everything you already love about Messenger—your...Category: Instant messaging
License: Freeware/gratuit
Download FileZilla Server 0.9.25FileZilla Server - FileZilla Server is an FTP server supports FTP and FTP over SSL/TLS.Category: FTP
License: Open Source
Download Opera for Windows 9.50Opera for Windows - Possibilty to download a version compatible with Linux, MacOS, Solaris, FreeBSD ... <h2> </h2> The Opera Web browser...Category: Browser
License: Freeware/gratuit
More freeware about « problem with include on windows NT server »