php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23862 include_once no longer will include main file
Submitted: 2003-05-28 14:00 UTC Modified: 2003-05-29 14:50 UTC
From: jason at rpdesign dot com Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.3.1 OS: Gentoo Linux PPC
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jason at rpdesign dot com
New email:
PHP Version: OS:

 

 [2003-05-28 14:00 UTC] jason at rpdesign dot com
include_once will not include the file that the browser has requested. even if it has not been executed yet (from withith the auto_prepend_file.)

I am using mod_php with apache 2.

In my .htaccess file I have:

  php_value auto_prepend_file prep.php

in prep.php I have:

  ...
  # Get the name of the file requested from the browser
  $mainfile = ereg_replace('.*/', '', $_SERVER['SCRIPT_FILENAME']);

  include_once($mainfile);

This now does nothing.

With php 4.2.1 on your x86 RedHat box this works fine.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-29 13:17 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Since the file was already included, the include_once fails, this is expected behaviour.
 [2003-05-29 13:24 UTC] jason at rpdesign dot com
The file has not been included yet. When I put function definitions in the file, the functions aren't defined. When I put syntax errors in the file, they are not reported. The file has not been executed or even parsed. I think it should definately not be marked as "included".
 [2003-05-29 14:50 UTC] wez@php.net
This is the expected behaviour.
Not a bug in PHP.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 02:01:31 2024 UTC