Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2009
    Posts
    90
    Thanks
    5
    Thanked 0 Times in 0 Posts

    file_get_contents question

    I rely on file get contents like this
    PHP Code:
    file_get_contents('http://www.externalsite.co.uk/search1.php?q='.$file_name); 
    and it will retreive all split winrar parts to download for the file passed from the query and this is from another external site I run where the files are stored.

    The above is run 5 times per page, but since yesterday the page stopped downloading and just hangs, so I limited the pagination to show 1 file per page so will only call file get contents once per page this solved the problem so the webpage would load.

    I'm sure it's the server on my external site that has somehow slowed down, and there for freezes the page trying to get the contents. On the other side of things I doubt it but the shared server file get contents runs on maybe they have reduced my php memory limit, but I googled a bit on this and from what I have found it doesn't use much memory?

    I thought I would just ask the before I raise a support ticket

  • #2
    Codeasaurus Rex
    Join Date
    Jun 2008
    Location
    Redmond, WA
    Posts
    660
    Thanks
    31
    Thanked 100 Times in 94 Posts
    As code does not often change itself on its own, usually it's a good bet that something external has happened if you haven't modified your code in any way that would cause it to stop working.

    When I see this, and also see you're on a shared host, I immediately think that the hosting company many have throttled you in some way. Most web hosts very much frown on file hosting websites, typically because it costs them more money to host.

    Your easiest bet is to submit that ticket and see if your host has changed anything on their end. If that doesn't pan out, check to make sure any changes you've made didn't have unintended effects. This will be in any server settings, control panel settings, PHP.INI, or httpd.conf.

    Unfortunately with ambiguous problems like this we can't really give you a "Go here and change this" fix. Best to retrace your steps and debug in that way.
    Unless otherwise stated, any code posted is most likely untested and may contain syntax errors.
    My posts, comments, code, and suggestions reflect only my personal views.
    Web Portfolio and Code Snippets: http://shanechism.com


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •