Page 1 of 1

require_once ??

Posted: Fri Jan 12, 2007 2:30 pm
by venadder
Jcart | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


hi,
I am new to PHP and have this weird problem. using a config.php file to set some basic defines in the project. It works throuout except in one case and I have tried to find what's goign on but havn't been able to figure out.

Code: Select all

//file config. php folder: webroot/lib/base
<?php
define( "TEST_CONFIG", '1' );
?>
file: example.php folder: webroot/lib/classes

Code: Select all

<?php

require_once( 'lib/base/config.php' );

if( defined( 'TEST_CONFIG' ) )
    echo 'works';
else
   echo 'oops';
?>
somehow the test always fails and I always get oops???

can some one help me with a few hints, please?

thnak you


Jcart | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Fri Jan 12, 2007 2:49 pm
by Luke
hint: turn php errors on

Posted: Fri Jan 12, 2007 5:13 pm
by venadder
It was actually puling a different config file.

The problem was related to include path environment variable.

Thanx for help

Posted: Fri Jan 12, 2007 5:18 pm
by Luke
:wink: