Fatal error during include :(

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

    Fatal error during include :(

    Hello, I am using php5 and I've got this piece of code:

    include ('http://something.somew here/file.php?a=act' )

    PHP instead of including file five me:

    [13-May-2005 12:17:38] PHP Fatal error: Unknown: Security alert:
    Include filename is an URL in Unknown on line 0


    My php.ini contains:

    safe_mode = Off
    allow_url_fopen = On

    <? phpinfo() ?> shows that this values are correct.


    Why it is happens? What can I do?

    Cheers,

    --
    Rafal Bluszcz Zawadzki
    JabberPL.org SysAdmin
    ----------------------
  • Azeus

    #2
    Re: Fatal error during include :(

    Rafal Zawadzki wrote:[color=blue]
    > Hello, I am using php5 and I've got this piece of code:
    >
    > include ('http://something.somew here/file.php?a=act' )[/color]

    This really can't be done. Only local files can be included.
    [color=blue]
    > PHP instead of including file five me:
    >
    > [13-May-2005 12:17:38] PHP Fatal error: Unknown: Security alert:
    > Include filename is an URL in Unknown on line 0[/color]

    This message says what I said before.
    [color=blue]
    >
    > My php.ini contains:
    >
    > safe_mode = Off
    > allow_url_fopen = On[/color]

    fopen says it all. This means php allows you to open a file from a URL.

    So if you want to read a remote file use fopen.
    [color=blue]
    > <? phpinfo() ?> shows that this values are correct.
    >
    >
    > Why it is happens? What can I do?
    >
    > Cheers,
    >[/color]

    Comment

    • Daniel Tryba

      #3
      Re: Fatal error during include :(

      Azeus <IFARTINYOURGEN ERALDIRECTION@m p.com> wrote:[color=blue][color=green]
      >> include ('http://something.somew here/file.php?a=act' )[/color]
      >
      > This really can't be done. Only local files can be included.[/color]

      Really? Then the manual should be fixed:

      'If "URL fopen wrappers" are enabled in PHP (which they are in the
      default configuration), you can specify the file to be included using a
      URL (via HTTP or other supported wrapper - see Appendix L for a list of
      protocols) instead of a local pathname.'
      [color=blue][color=green]
      >> PHP instead of including file five me:
      >>
      >> [13-May-2005 12:17:38] PHP Fatal error: Unknown: Security alert:
      >> Include filename is an URL in Unknown on line 0[/color]
      >
      > This message says what I said before.[/color]

      Maybe not:

      "Warning

      Windows versions of PHP prior to PHP 4.3.0 do not support accessing
      remote files via this function, even if allow_url_fopen is enabled."
      [color=blue][color=green]
      >> My php.ini contains:
      >>
      >> safe_mode = Off
      >> allow_url_fopen = On[/color]
      >
      > fopen says it all. This means php allows you to open a file from a URL.
      >
      > So if you want to read a remote file use fopen.[/color]

      So example 16-7 on http://nl3.php.net/include/ is wrong?

      Comment

      • Philip  Olson

        #4
        Re: Fatal error during include :(

        According to your description of settings and code, it should work.
        Include can in fact include remote files. Have you tried other URL's
        that will work, such as google.com?

        Comment

        • Chung Leong

          #5
          Re: Fatal error during include :(

          Your copy of PHP has the Hardened-PHP patch. Including of URLs is
          disabled, period.

          There is no legitimate reason to include a URL. Doing so is almost
          always a mistake. If you want to show the contents of a web page, use
          readfile().

          Comment

          Working...