Page 1 of 1

Installation Problems

Posted: Wed Apr 07, 2004 10:29 am
by xgator
I am a complete newbie to php but so far I love the capabilities. I recently installed php4 on a server at work (for internal use only). I made a simple php page that contains the following:

<?
// Prevent obsessive/compulsive reloads
//session_cache_limiter('public');

$pagetitle = "Central Station: Your information Portal!!";
include("..\shared\header.php");

$thedate = getdate();
$today = $thedate['month']." ".$thedate['mday'].", ".$thedate['year'];
?>

<p><b>Today is <? echo "$today"; ?>.</b></p>

<? include("..\content\index_content.htm");
include("..\shared\footer.php"); ?>

When I try to view the page from a browser (localhost or remote machine) I get the following:
Warning: main(..\shared\header.php): failed to open stream: No such file or directory in c:\inetpub\wwwroot\index.php on line 7

Warning: main(): Failed opening '..\shared\header.php' for inclusion (include_path='.;C:\php4\includes\pear') in c:\inetpub\wwwroot\index.php on line 7

Today is April 7, 2004.


Warning: main(..\content\index_content.htm): failed to open stream: No such file or directory in c:\inetpub\wwwroot\index.php on line 16

Warning: main(): Failed opening '..\content\index_content.htm' for inclusion (include_path='.;C:\php4\includes\pear') in c:\inetpub\wwwroot\index.php on line 16

Warning: main(..\shared\footer.php): failed to open stream: No such file or directory in c:\inetpub\wwwroot\index.php on line 17

Warning: main(): Failed opening '..\shared\footer.php' for inclusion (include_path='.;C:\php4\includes\pear') in c:\inetpub\wwwroot\index.php on line 17


Any help would be greatly appreciated. I am sure this is something simple but for the life of me I cannot find it.

Thanks,

Lee

Posted: Sat Oct 02, 2004 5:15 pm
by JasonMichael
Are you sure that you have the PHP script that you're running (index.php I assume) at the same directory level as your SHARED diretory and CONTENT directory?

Personally, I would have index.php at my root directory,and then be referencing SHARED and CONTENT as directories below root... but I guess this is just my own personal style.

If you DO happen to have index.php at your root, then its an easy fix... take out the "..\" from the front of the path references you have in your code and you should be all set... basically, those errors are just telling you that PHP can't find the files where you were trying to tell it to look.

Hope this helps.

Posted: Sat Oct 02, 2004 5:23 pm
by Breckenridge
try using full path + file name in your include statement. i.e. c:\server\shared\file.php