Jump to content
Larry Ullman's Book Forums

Brian

Members
  • Posts

    2
  • Joined

  • Last visited

Brian's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Thanks for replying, Larry - no, there is not any error shown, just a completely blank page (unless I print debug statements before I attempt to require config.inc.php). EDIT: <facedesk> oh man, this is embarrassing. Adding this: ini_set('display_errors', 'On'); error_reporting(E_ALL); revealed that I had misplaced a parenthesis in my config file, like " if (empty($var && ..."; interesting that this syntax error never caused any problems when used on my localhost, but there it is. Sorry to waste your time with such a plebeian mistake
  2. 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
×
×
  • Create New...