Greetings,
I designed a site mostly following the first example in the book, and it works and looks great on my localhost; however, the script immediately fails when live, whether I use require or include for the config.inc.php file.
My index.php file looks like this, with some attempted debugging:
<?php
echo "./ is the current working directory, i.e. " . getcwd();
echo "<p>Attempting to require './includes/config.inc.php'</p>";
require './includes/config.inc.php'; // changing to include also fails
echo "Success!"; // does not print
// rest of code
// other includes work fine if I remove the first
// "require './includes/config.inc.php'"
include "./includes/header.html";
According to the output, my working directory for the live site is '/home/myname/public_html', which is where the index.php file and all my folders reside. Locally, the same files and folders are in 'C:\wamp\www\myfolder'.
I contacted my web host but all they could say is there must be an error in my php, but it fails on literally the very first require statement for reasons I cannot fathom.
Any suggestions?
Thanks for your help,
Brian
P.S: Larry, your book is great so far - I'm looking forward to part two!
EDIT: For completeness, here is the beginning of my config.inc.php file:
<?php //=====This file should be included in every other file.======//
// prints locally, but not live, suggesting that the file is not found when live
// even though other files in the include directory can be found
echo "<p><br><br>Including config.inc.php</p>";
if (!defined('LIVE')) { DEFINE('LIVE', TRUE); } // Of course I change this as needed
DEFINE('BASE_URL', (LIVE ? 'http://mysite.net/' : '/mysite/'));
// rest of code