Function file() not working out of the box on several linux distribution

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jon.berg@gmail.com

    Function file() not working out of the box on several linux distribution

    I have a problem getting the file() function in PHP to work on several
    linux distributions, for example fedora core 3.

    For example file('http://someurl.com/') do not return the content of
    that page.

    This is when I use the version of Apache and PHP that comes with the
    operating system. When I compile Apache and PHP from source it works.
    Is there some configuration that can be done so it will work? I need to
    make it work on a server where I can not recompile from the source of
    Apache and PHP.

    Jon Berg.

  • Janwillem Borleffs

    #2
    Re: Function file() not working out of the box on several linux distribution

    jon.berg@gmail. com wrote:[color=blue]
    > For example file('http://someurl.com/') do not return the content of
    > that page.
    >[/color]

    Does file() work when requesting "http://www.google.com/"? Then the site you
    are probing requires more headers (e.g. user-agent, cookies) than the file()
    function provides by default. Try opening the site in FireFox with the
    LiveHeaders extension installed and check the received headers.

    It is also possible that some boxes simply do not have access to the site,
    in which case the configuration of the machine hosting the site should be
    modified.


    JW



    Comment

    • Andy Hassall

      #3
      Re: Function file() not working out of the box on several linux distribution

      On 24 Jun 2005 07:16:23 -0700, jon.berg@gmail. com wrote:
      [color=blue]
      >I have a problem getting the file() function in PHP to work on several
      >linux distributions, for example fedora core 3.
      >
      >For example file('http://someurl.com/') do not return the content of
      >that page.
      >
      >This is when I use the version of Apache and PHP that comes with the
      >operating system. When I compile Apache and PHP from source it works.
      >Is there some configuration that can be done so it will work? I need to
      >make it work on a server where I can not recompile from the source of
      >Apache and PHP.[/color]



      Unless:

      ... was used at compile time.

      --
      Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
      <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

      Comment

      Working...