open_basedir errors

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul

    open_basedir errors

    Hi

    Im testing a script to see if it works in different situations and
    open_basedir is one of them. However if i turn it On all i get is errors

    Warning: Unknown(): open_basedir restriction in effect.
    File(c:\web\htt pdocs\session.p hp) is not within the allowed path(s): (1)
    in Unknown on line 0

    Warning: Unknown(c:\web\ httpdocs\sessio n.php): failed to open stream:
    Operation not permitted in Unknown on line 0

    Warning: (null)(): Failed opening 'c:\web\httpdoc s\session.php' for
    inclusion (include_path=' .;c:\php4\pear' ) in Unknown on line 0


    This code has no includes infact the file is only this

    <?php
    phpinfo();
    ?>

    How can i make this work.

    Help is greatly appreciated


    I should mention this is on a local testing machine WinXP and im using
    PHP 4.3.7 and the httpdocs directory is the document root.
  • Alvaro G Vicario

    #2
    Re: open_basedir errors

    *** Paul wrote/escribió (Tue, 24 Aug 2004 09:09:20 GMT):[color=blue]
    > Warning: Unknown(): open_basedir restriction in effect.
    > File(c:\web\htt pdocs\session.p hp) is not within the allowed path(s): (1)
    > in Unknown on line 0[/color]

    You've probably set the open_basedir directive somewhere. That restricts
    PHP access to certain directories. Check php.ini and your Apache config
    files (http.conf, .htacces, etc).


    --
    -- Álvaro G. Vicario - Burgos, Spain
    -- Questions sent to my mailbox will be billed ;-)
    --

    Comment

    • Paul

      #3
      Re: open_basedir errors


      Thanks for replying.

      Sorry to be sounding rude but i believe i mentioned i was using
      open_basedir On in the php.ini

      "Im testing a script to see if it works in different situations and
      open_basedir is one of them. However if i turn it On all i get is errors"

      I probably should say how do i make sure that i dont get these errors
      with it On. I dont see it with it off. Is there anything else the
      open_basedir looks for.

      Alvaro G Vicario wrote:[color=blue]
      > *** Paul wrote/escribió (Tue, 24 Aug 2004 09:09:20 GMT):
      >[color=green]
      >>Warning: Unknown(): open_basedir restriction in effect.
      >>File(c:\web\h ttpdocs\session .php) is not within the allowed path(s): (1)
      >>in Unknown on line 0[/color]
      >
      >
      > You've probably set the open_basedir directive somewhere. That restricts
      > PHP access to certain directories. Check php.ini and your Apache config
      > files (http.conf, .htacces, etc).
      >
      >[/color]

      Regards
      Paul

      Comment

      • Markus Ernst

        #4
        Re: open_basedir errors

        Paul <p_mcilwaine@ip rimus.com.au> schrieb:[color=blue]
        > Hi
        >
        > Im testing a script to see if it works in different situations and
        > open_basedir is one of them. However if i turn it On all i get is
        > errors
        >
        > Warning: Unknown(): open_basedir restriction in effect.
        > File(c:\web\htt pdocs\session.p hp) is not within the allowed path(s):
        > (1) in Unknown on line 0
        >
        > Warning: Unknown(c:\web\ httpdocs\sessio n.php): failed to open stream:
        > Operation not permitted in Unknown on line 0
        >
        > Warning: (null)(): Failed opening 'c:\web\httpdoc s\session.php' for
        > inclusion (include_path=' .;c:\php4\pear' ) in Unknown on line 0[/color]

        Is the original code like that:

        include("/session.php");

        ? Then try to make the path absolute:

        include($_SERVE R['DOCUMENT_ROOT']."/session.php");

        HTH
        Markus


        Comment

        • Paul

          #5
          Re: open_basedir errors

          Markus Ernst wrote:[color=blue]
          > Paul <p_mcilwaine@ip rimus.com.au> schrieb:
          >[color=green]
          >>Hi
          >>
          >>Im testing a script to see if it works in different situations and
          >>open_basedi r is one of them. However if i turn it On all i get is
          >>errors
          >>
          >>Warning: Unknown(): open_basedir restriction in effect.
          >>File(c:\web\h ttpdocs\session .php) is not within the allowed path(s):
          >>(1) in Unknown on line 0
          >>
          >>Warning: Unknown(c:\web\ httpdocs\sessio n.php): failed to open stream:
          >>Operation not permitted in Unknown on line 0
          >>
          >>Warning: (null)(): Failed opening 'c:\web\httpdoc s\session.php' for
          >>inclusion (include_path=' .;c:\php4\pear' ) in Unknown on line 0[/color]
          >
          >
          > Is the original code like that:
          >
          > include("/session.php");
          >
          > ? Then try to make the path absolute:
          >
          > include($_SERVE R['DOCUMENT_ROOT']."/session.php");
          >
          > HTH
          > Markus
          >
          >[/color]

          Actually the file (session.php) is just

          <?php
          phpinfo();
          ?>

          Which is why im so stumped.

          Comment

          • Markus Ernst

            #6
            Re: open_basedir errors

            Paul <p_mcilwaine@ip rimus.com.au> schrieb:[color=blue]
            > Markus Ernst wrote:[color=green]
            >> Paul <p_mcilwaine@ip rimus.com.au> schrieb:
            >>[color=darkred]
            >>> Hi
            >>>
            >>> Im testing a script to see if it works in different situations and
            >>> open_basedir is one of them. However if i turn it On all i get is
            >>> errors
            >>>
            >>> Warning: Unknown(): open_basedir restriction in effect.
            >>> File(c:\web\htt pdocs\session.p hp) is not within the allowed path(s):
            >>> (1) in Unknown on line 0
            >>>
            >>> Warning: Unknown(c:\web\ httpdocs\sessio n.php): failed to open
            >>> stream: Operation not permitted in Unknown on line 0
            >>>
            >>> Warning: (null)(): Failed opening 'c:\web\httpdoc s\session.php' for
            >>> inclusion (include_path=' .;c:\php4\pear' ) in Unknown on line 0[/color]
            >>
            >>
            >> Is the original code like that:
            >>
            >> include("/session.php");
            >>
            >> ? Then try to make the path absolute:
            >>
            >> include($_SERVE R['DOCUMENT_ROOT']."/session.php");
            >>
            >> HTH
            >> Markus
            >>
            >>[/color]
            >
            > Actually the file (session.php) is just
            >
            > <?php
            > phpinfo();[color=green]
            >>[/color]
            >
            > Which is why im so stumped.[/color]

            So session.php is not included from an other script, but called directly
            from the browser's address line? Really strange. Sorry I am not familiar
            with php.ini stuff; I just solved open_basedir restriction errors with
            includes that way.

            BTW I assume the missing question mark in your PHP end tag is a typo in your
            posting, not in your file?

            --
            Markus


            Comment

            • Virgil Green

              #7
              Re: open_basedir errors


              "Paul" <p_mcilwaine@ip rimus.com.au> wrote in message
              news:4BDWc.5100 $D7.2373@news-server.bigpond. net.au...[color=blue]
              >
              > Warning: Unknown(): open_basedir restriction in effect.
              > File(c:\web\htt pdocs\session.p hp) is not within the allowed path(s): (1)
              > in Unknown on line 0[/color]

              I'm not near a php machine at the moment, but I seem to remember that the
              "(1)" in your error message normally shows the paths allowed by
              open_basedir. Did you "turn on" open_basedir by setting it to the value of
              1? The value is supposed to be set to the list of directories (actually,
              prefixes) to which the user is allowed access.

              - Virgil


              Comment

              • Paul

                #8
                Re: open_basedir errors

                Virgil Green wrote:[color=blue]
                > "Paul" <p_mcilwaine@ip rimus.com.au> wrote in message
                > news:4BDWc.5100 $D7.2373@news-server.bigpond. net.au...
                >[color=green]
                >>Warning: Unknown(): open_basedir restriction in effect.
                >>File(c:\web\h ttpdocs\session .php) is not within the allowed path(s): (1)
                >>in Unknown on line 0[/color]
                >
                >
                > I'm not near a php machine at the moment, but I seem to remember that the
                > "(1)" in your error message normally shows the paths allowed by
                > open_basedir. Did you "turn on" open_basedir by setting it to the value of
                > 1? The value is supposed to be set to the list of directories (actually,
                > prefixes) to which the user is allowed access.
                >
                > - Virgil
                >
                >[/color]

                Thanks that did it i was doing the configuration wrong. Once again
                thanks very much

                Paul

                Comment

                Working...