#21038 [Opn->Fbk]: require & require_once probs
| From: | rasmus@php.net | Date: | Mon, 16 Dec 2002 08:02:35 +0000 |
| Subject: | #21038 [Opn->Fbk]: require & require_once probs | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-27822@lists.php.net to get a copy of this message | ||
ID: 21038
Updated by: rasmus@php.net
Reported By: hbaes@chiemgaudata.de
-Status: Open
+Status: Feedback
Bug Type: *General Issues
Operating System: Linux
PHP Version: 4.3.0RC3
New Comment:
Well, the difference between include and require is that require will
throw a fatal when it can't find the file and include will just give
you a warning. So, it sounds to me like your new install simply can't
find the file in both cases and you are only seeing the fatal error
message. Perhaps your include_path is set differently in this new
install?
Previous Comments:
------------------------------------------------------------------------
[2002-12-16 01:19:27] hbaes@chiemgaudata.de
since the update from 4.2.3 to 4.3.0RC3 I´ve found several scripts (i.e
the pdflib-test-scripts) which have probs with require() and
require_once() !
If I have a "master" include file with the following content:
// Include the classes
if ( !defined( "INC" ) ) {
/**
* Include the main object
*
*/
require_once( "main.inc" );
/**
* Include the page object
*
*/
require_once( "page.inc" );
...
(main.inc and page.inc are in the same dir as the "master" include
(/include) ..)
I get following error when I run my script:
Fatal error: main() [function.main]: Failed opening required 'main.inc'
(include_path='.:/usr/local/lib/php:/home/www/web2/html/pdf/pc4p/include')
in /home/www/web2/html/pdf/pc4p/include/init.inc on line 36
if i change the require_once to include_once then everything works fine
....
best regards
Harald
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21038&edit=1