to stupid to see the mistake - include_path don't work

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mirko@abitur97.de

    to stupid to see the mistake - include_path don't work

    Hello,

    I have a problem with my include_path and I don't know why... Can
    anybody see the mistake?

    my configuration:

    PHP Version 4.3.11

    System: Windows NT 5.0 build 2195
    Server API: CGI/FastCGI
    Virtual Directory Support: enabled
    Configuration File (php.ini) Path: C:\WINNT\php.in i
    PHP API: 20020918
    PHP Extension: 20020429
    Thread Safety: enabled
    include_path: .;C:\Inetpub\ww wroot

    My php script used this:

    require("/development/classes/configWeb.php") ;

    and the configWeb File location is:
    C:\Inetpub\wwwr oot\development \classes\config Web.php

    And I geet this error message:
    Fatal error: getofficeslist( ): Failed opening required
    '\development\c lasses\configWe b.php'
    (include_path=' .;C:\Inetpub\ww wroot') in
    C:\Inetpub\wwwr oot\development \classes\office s.php on line 45

    THANKS !

  • Kim André Akerø

    #2
    Re: to stupid to see the mistake - include_path don't work

    mirko@abitur97. de wrote:
    [color=blue]
    > Hello,
    >
    > I have a problem with my include_path and I don't know why... Can
    > anybody see the mistake?
    >
    > my configuration:
    >
    > PHP Version 4.3.11
    >
    > System: Windows NT 5.0 build 2195
    > Server API: CGI/FastCGI
    > Virtual Directory Support: enabled
    > Configuration File (php.ini) Path: C:\WINNT\php.in i
    > PHP API: 20020918
    > PHP Extension: 20020429
    > Thread Safety: enabled
    > include_path: .;C:\Inetpub\ww wroot
    >
    > My php script used this:
    >
    > require("/development/classes/configWeb.php") ;
    >
    > and the configWeb File location is:
    > C:\Inetpub\wwwr oot\development \classes\config Web.php
    >
    > And I geet this error message:
    > Fatal error: getofficeslist( ): Failed opening required
    > '\development\c lasses\configWe b.php'
    > (include_path=' .;C:\Inetpub\ww wroot') in
    > C:\Inetpub\wwwr oot\development \classes\office s.php on line 45[/color]

    What your script is actually trying to access, is
    "c:\development \classes\config Web.php", which is referenced in the
    require() statement above. If you remove the slash from the beginning
    of that file reference, you'll see that it works.

    The way include_path works, it goes through each of the directories
    (seperated by a semicolon) when you use include/require with a relative
    path until it finds the file. This is only a side feature, since
    include_path is meant to secure which directories a script is allowed
    to include files from.

    It will in your case look for the included file here (if making the
    change I suggested):
    ..\development\ classes\configW eb.php (from current working directory)
    c:\Inetpub\wwwr oot\development \classes\config Web.php

    --
    Kim André Akerø
    - kimandre@NOSPAM betadome.com
    (remove NOSPAM to contact me directly)

    Comment

    • h00s

      #3
      Re: to stupid to see the mistake - include_path don't work

      On 21 Oct 2005 00:09:04 -0700, mirko@abitur97. de wrote:
      [color=blue]
      >require("/development/classes/configWeb.php") ;[/color]

      my guess is that this should be like this:
      require("develo pment/classes/configWeb.php") ;
      --
      - Marketer to coder: "You start coding. I'll go find out what they want." -
      mail: kruno@binel-withoutspam.hr | uin: 2040925

      Comment

      • mirko@abitur97.de

        #4
        Re: to stupid to see the mistake - include_path don't work

        Thanks for the description how include_path works. Now it works!

        Mirko

        Comment

        Working...