php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19291 Include file failure with PHP 4.2.3
Submitted: 2002-09-08 10:24 UTC Modified: 2002-09-26 12:04 UTC
From: fillmore at NRCan dot gc dot ca Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.2.3 OS: Solaris 8
Private report: No CVE-ID: None
 [2002-09-08 10:24 UTC] fillmore at NRCan dot gc dot ca
Some PHP scripts that worked fine in 4.2.2 now fail in 4.2.3 with a message:
  "Fatal error: Call to undefined function: requireversion() in /home1/fast1/WWW-data/ess/_ess.php on line 11"

The file _ess.php is included in the main file index_e.php as follows:

   require_once("_ess.php");

The "requireversion" function is defined in the file _lib.php, which is included
in the file _ess.php as follows:

   if(file_exists("_lib.php")){
        require_once("_lib.php");
   }

   //this requires version 4.2+
   requireversion('4.2');


We are using the NSAPI (iPlanet 4.x) version of PHP.

Thanks,

  Bob Fillmore

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-08 12:25 UTC] kalowsky@php.net
requireversion?

did you mean phpversion?
 [2002-09-08 12:50 UTC] wez@php.net
Sounds like a dup of #19287 (file_exists fails).
Can you amend your script like this:

if(file_exists("_lib.php")){
   require_once("_lib.php");
} else {
   trigger_error("_lib.php does not exist!");
}


 [2002-09-08 13:13 UTC] fillmore at NRCan dot gc dot ca
I will try to set up a proper test environment for this.
Note that this application uses relative path includes-
the file _lib.php exists in some directories but not others,
so just issuing an error will mess up the application.
Using absolute paths for the includes is a bit messy, 
because they would have to be dynamically built 
by parsing the URL each time.
However, thanks for the suggestion.
 [2002-09-08 13:29 UTC] sander@php.net
Wez asked you that to find out if it was a problem with file_exists(). As an experiment, can you please try adding the else clause as Wez sugested, and see if it spawns errors on all pages (including those where _lib.php should be available)?
 [2002-09-08 13:30 UTC] sander@php.net
Or even easier, set up a the following test script:
<?php echo (int) file_exists(basename($_SERVER['PHP_SELF'])); ?>
It should print a 1. 
 [2002-09-08 13:47 UTC] fillmore at NRCan dot gc dot ca
I ran a quick test with trigger_error as suggested, 
and saw the following errors:

Notice: _lib.php does not exist! in /home1/fast1/WWW-data/ess/_ess.php on line 9

Fatal error: Call to undefined function: requireversion() in /home1/fast1/WWW-data/ess/_ess.php on line 13

So, it looks like it is the "file_exists" problem.

  - Bob
 [2002-09-08 13:56 UTC] kalowsky@php.net
As per Wez's observation... dup of #19287
 [2002-09-08 14:03 UTC] fillmore at NRCan dot gc dot ca
Just to be thorough, I also tried the test script with:
<?php echo (int) file_exists(basename($_SERVER['PHP_SELF'])); ?>

It prints a "0", so I guess the bug is not specific to
include file processing.
 [2002-09-26 12:04 UTC] sniper@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 19:01:30 2024 UTC