|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21038 require & require_once probs
Submitted: 2002-12-16 01:19 UTC Modified: 2003-01-02 18:50 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: hbaes at chiemgaudata dot de Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: 4.3.0RC3 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: hbaes at chiemgaudata dot de
New email:
PHP Version: OS:


 [2002-12-16 01:19 UTC] hbaes at chiemgaudata dot 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( "" );

	* Include the page object
	require_once( "" );


( and 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 '' (include_path='.:/usr/local/lib/php:/home/www/web2/html/pdf/pc4p/include') in /home/www/web2/html/pdf/pc4p/include/ on line 36

if i change the require_once to include_once then everything works fine ....

best regards


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-16 02:02 UTC]
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?
 [2002-12-16 02:11 UTC] hbaes at chiemgaudata dot de
Hi Rasmus,

I?m sorry to say, but the include path (the path where this script resides ) is: /home/www/web2/html/pdf/pc4p/include
like You can see.

I downloaded the latest Snapshort and reinstalled it a few minutes ago, and I still have the same Probs with ALL my Scripts which use require ....

It can?t be the include path, because if You look at the error output you can see, that the error-location file ( is in the include path. the files and stay in the same Directory :-(

And: it?s NO difference if you use require_once("./"), require_once(""), require_once('') and so on ...

The whole config-set in php.ini had been taken from my old 4.2.3.

PS.: using php as Apache Dynamic .so lib ...


(ps: test: )
(orig example of pdflib )
 [2002-12-16 02:26 UTC]

as I can see the PHP script 'wirtz_pc4p.php' includes the file '' which is located in /home/www/web2/html/pdf/pc4p/include/.

The file ( includes other files (without suppling a path) which should be located in (because this is the current directory)


/home/www/web2/html/pdf/pc4p/include/ (because this is in the include path)

Where is the file '' located? I tried to list the directory in, but this wasn't allowed.


 [2002-12-16 02:45 UTC] hbaes at chiemgaudata dot de

here is the content:

so the included files are a.) in the same file as the including file ( and b.) inside the include_path (as listened in the error aoutput).

I had this problem with another script, too, which used nasted require_once() commands (a kind of shop-engine).
With 4.2.3 it works fine, but since 4.3.0RC3 the script got the same problem as the above pdflib-demo ...
 [2002-12-16 05:19 UTC]
Set 'error_reporting=E_ALL' and then try with the include_once() instead.

 [2003-01-02 18:50 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Feb 06 04:04:08 2023 UTC