faqts : Computers : Programming : Languages : PHP : Common Problems : Errors

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

18 of 32 people (56%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

Warning: Failed opening '../Globals.php4' for inclusion wht shall i do?

May 16th, 2001 08:05
Philip Olson, rt pt,


Make sure your include_path settings are correct, odds are they are 
not.  Have a look at the following manual entry :
  Chapter 3. Configuration
  http://www.php.net/manual/configuration.php#ini.include-path
Note the . in the example settings, this is important.  Examples read 
as such :
  Example 3-1. UNIX include_path
    include_path=.:/home/httpd/phplib
  Example 3-2. Windows include_path
    include_path=".;c:\www\phplib"
The . essentially means "current directory" as without it (in the above 
example) the only possible includes would come from /home/httpd/phplib 
and www\phplib respectivly (of course you can add as many as you 
like).  Having the . means the following will look for includes in/from 
the current working directory (where the include is taking place).  A 
few examples :
   <?php
      # this file /home/www/foo/bar/index.php
      # from /home/www/foo/bar/globals.inc
      include 'globals.inc';  
      # from /home/www/foo/globals.inc
      include '../globals.inc';
      # from /home/www/foo/bar/includes/globals.inc
      include './includes/globals.inc';
   ?>
If your include_path is set correct then perhaps the file does not 
exist or has incorrect permissions.