1

This is engine.php (works fine):

<?php
include ('settings/server_settings.php');  
include ('settings/tables.php');  
?>

Now i create settings.php in the same folder, and with the same content as engine.php, and then i include this file to engine.php, so i get this:

engine.php:

<?php 
include ('settings.php');  
?>

settings.php:

<?php
include ('settings/server_settings.php');  
include ('settings/tables.php');  
?>

And now i dont get any errors (but a random empty(!) line on the top of the page) and i cant use the functions, etc from server_settings.php and tables.php. It seems it fails to include, BUT there are no error message. (In other cases i get error message [misspelling the location, etc])

Whats wrong ?

4
  • 2
    Is your error reporting turned on? Commented Aug 8, 2011 at 6:56
  • try require, so there will be an error if php can't include the files Commented Aug 8, 2011 at 6:57
  • Try require instead of include: require('settings.php"); Commented Aug 8, 2011 at 6:58
  • I had the same problem once, include only worked once. I don't know if it was a typo or a server issue Commented Aug 8, 2011 at 7:04

1 Answer 1

2

Try changing engine.php to

<?php
ini_set('display_errors', 'On');
error_reporting(E_ALL);

require_once 'settings.php';

Check your files for a Byte Order Mark at the top of the file. Some editors (like DreamWeaver) will hide these.

Sign up to request clarification or add additional context in comments.

1 Comment

Converted to UTF-8 without BOM and it saved the day ! Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.