php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24593 class not instantiated problem with include/require
Submitted: 2003-07-10 11:31 UTC Modified: 2003-07-10 11:37 UTC
From: ssem at complexusgroup dot com Assigned:
Status: Not a bug Package: *Directory Services problems
PHP Version: 4CVS-2003-07-10 (stable) OS: apache
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: ssem at complexusgroup dot com
New email:
PHP Version: OS:

 

 [2003-07-10 11:31 UTC] ssem at complexusgroup dot com
Description:
------------
when I use

include("http://".$_SERVER['HTTP_HOST']."/bread.php");

and

include("bread.php");

the include found both files.  But when I try to instantiate an instance of an class in bread.php, only include("bread.php"); works???????

the reason I am using $_server variable is to have an absolute path for file at different subdirectories to call bread.php

Reproduce code:
---------------
//include("http://".$_SERVER['HTTP_HOST']."/bread.php");

include("bread.php");
$b =new bread();
echo $b->trace($ctid, $pctid);

//works fine but if I use

include("http://".$_SERVER['HTTP_HOST']."/bread.php");
//include("bread.php");
$b =new bread();
echo $b->trace($ctid, $pctid);\

//I got the error in the following section.  

Expected result:
----------------
no error

Actual result:
--------------
Fatal error: Cannot instantiate non-existent class: bread in /hsphere/local/home/developm/hsc.development.complexusgroup.com/common/header.php on line 67


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-10 11:37 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

RTFM about include()..

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 12:01:28 2024 UTC