SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    SitePoint Addict jessebhunt's Avatar
    Join Date
    Dec 2003
    Location
    Insomnia
    Posts
    278
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Locally reloading files got my site suspended...

    Hi:

    One of my sites recently got suspended from my hosting plan because the host said that the script had files that were reloading locally too much.

    He gave me a list of the files, and it appears that they are all files which were 'includes' to the main pages.

    Each main page has about 5 'includes' that allow me to easily update ads, headers, footers, etc.

    Anyway, I'm no PHP guru, so I'm hoping that you all can help me indentify the problem.

    I've used php includes on many other sites, and have never run into any problems.

    The code that I used to include the files is:
    Code:
    <?php @include ("http://www.domain.com/footer.php"); ?>
    That code looks really similar to the code that I've used many times before, but I'm not sure what the "@" does. Could it be the problem?

    If not, do you have any ideas as to what the problem is?

    Sorry, I can't post the url, because the site is currently offline until I get this problem fixed.

    Also, sorry if this is a stupid question.

    Thanks in advance.
    Now Hiring
    Looking for (x)html coder/ php programmer/
    WordPress expert for project work. PM me with
    your rates and work samples if you're interested.

  2. #2
    *munch munch* killerkooki's Avatar
    Join Date
    Sep 2004
    Location
    Singapore
    Posts
    405
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't see why including your files can get a site suspended. Perhaps you can explain it to them?

    And @ is used to suppress error messages. Clicky!

  3. #3
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    reloading pages

    I have never seen "@" in front of "include", but I imagine it has the same effect as in front of functions, that is, to suppress error reporting.
    I also imagine that the problem is not with the header or footer includes, but most likely the "ads" include. If you have the liberty to alter the ads include file please post it's contents. If you have some sort of financial agreement to adhere to you may have to get another host.

  4. #4
    SitePoint Addict jessebhunt's Avatar
    Join Date
    Dec 2003
    Location
    Insomnia
    Posts
    278
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well okay... I guess that rules out the "@" as the source of the problem.

    Regarding the ad code... it's just typical Google AdSense code. (Nothing fancy or wierd about it.)

    When I asked the host why the site had been suspended, here is what he said:
    One of your domains, www.domain.com, has been suspended for excessive system resource usage due to PHP scripts continually reloading themselves locally, this should not be happening and we cannot allow this to occur any further.

    17-2 30368 0/255/9904 _ 6.27 4 70 0.0 1.19 81.55 69.56.183.114 www.domain.com GET /topclass.php HTTP/1.0

    18-2 30369 0/352/9631 _ 11.63 21 131 0.0 1.72 58.26 69.56.183.114 www.domain.com GET /sitesub.php HTTP/1.0

    20-2 31319 0/252/8595 W 5.70 1 0 0.0 0.77 55.37 69.56.183.114 www.domain.com GET /topclass.php HTTP/1.0

    23-2 31337 0/181/6955 _ 4.24 21 124 0.0 1.32 38.48 69.56.183.114 www.domain.com GET /sitesub.php HTTP/1.0

    24-2 8037 1/67/6544 W 3.06 33 104 0.0 0.02 41.75 69.56.183.114 www.domain.com GET /sitesub.php HTTP/1.0

    28-2 9091 0/32/4449 _ 2.21 30 64 0.0 0.05 33.48 69.56.183.114 www.domain.com GET /topclass.php HTTP/1.0

    29-2 9156 0/17/4298 _ 1.11 30 45 0.0 0.00 27.38 69.56.183.114 www.domain.com GET /partner_links.php HTTP/1.0

    30-2 9159 0/31/4070 _ 2.15 4 153 0.0 0.00 24.47 69.56.183.114 www.domain.com GET /sitesub.php HTTP/1.0

    33-2 9672 0/16/3043 _ 1.38 13 137 0.0 0.03 15.68 69.56.183.114 www.domain.com GET /sitesub.php HTTP/1.0

    36-2 9730 0/12/2117 _ 1.00 35 42 0.0 0.00 11.25 69.56.183.114 www.domain.com GET /topclass.php HTTP/1.0

    37-2 8322 0/53/2265 W 2.12 32 0 0.0 0.16 10.37 69.56.183.114 www.domain.com GET /sitesub.php HTTP/1.0

    38-2 9731 0/13/1743 _ 1.45 28 127 0.0 0.02 13.39 69.56.183.114 www.domain.com GET /quickbar.php HTTP/1.0

    39-2 9734 0/11/1959 _ 0.73 4 108 0.0 0.00 7.69 69.56.183.114 www.domain.com GET /sitesub.php HTTP/1.0

    All of the files that he named are include files. However, not all of them appear on every page. This website has several thousand static pages, and the includes just allowed me to make easy updates to ads & navigation.


    Since I've added in the quote from the host, I decided to take a closer look at what's actually contained within the files that he named. ...Most all of them simply contain a little bit of html... nothing out of the ordinary at all. The only exception to this was the file "sitesub.php," which I can't seem to find at all.

    All of the other files that he named are contained in the main directory, but "sitesub.php" is not. I looked in every subdirectory that I thought it might be in, but I still can't find it.

    Obviously, you guys can't help me locate the missing file, but perhaps I posted something else that will help you to identify the problem. Did you see anything in the stuff that my host wrote that might solve my problem?

    Thanks again.
    Now Hiring
    Looking for (x)html coder/ php programmer/
    WordPress expert for project work. PM me with
    your rates and work samples if you're interested.

  5. #5
    SitePoint Addict
    Join Date
    Aug 2004
    Location
    Chicago
    Posts
    296
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Remove the domain name...

    include('footer.php') will load the file locally...
    include('http://domain.com/footer.php'); will actually make a HTTP request to it self, and cause the excessive system resouces.

    Quote the PHP manual:
    Quote Originally Posted by PHP Manual
    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. If the target server interprets the target file as PHP code, variables may be passed to the included file using a URL request string as used with HTTP GET. This is not strictly speaking the same thing as including the file and having it inherit the parent file's variable scope; the script is actually being run on the remote server and the result is then being included into the local script.
    Why's (Poignant) Guide to Ruby
    learn ruby with foxes, wizards, and chunky bacon

  6. #6
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bjcffnet
    Remove the domain name...

    include('footer.php') will load the file locally...
    include('http://domain.com/footer.php'); will actually make a HTTP request to it self, and cause the excessive system resouces.
    Note you might need the full path to the file, like

    /home/username/public_html/file.php

    or whatever...
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  7. #7
    SitePoint Addict jessebhunt's Avatar
    Join Date
    Dec 2003
    Location
    Insomnia
    Posts
    278
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    bjcffnet & weirdbeardmt:

    Thanks so much for the advice. I'll give it a try. Hopefully the host won't suspend it anymore... he said the next suspension is permanent. (However, it's not like I can't find a thousand other hosts!)

    Thanks again.
    Now Hiring
    Looking for (x)html coder/ php programmer/
    WordPress expert for project work. PM me with
    your rates and work samples if you're interested.

  8. #8
    Floridiot joebert's Avatar
    Join Date
    Mar 2004
    Location
    Kenneth City, FL
    Posts
    823
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jessebhunt
    bjcffnet & weirdbeardmt:

    Thanks so much for the advice. I'll give it a try. Hopefully the host won't suspend it anymore... he said the next suspension is permanent. (However, it's not like I can't find a thousand other hosts!)

    Thanks again.
    Don't take this the wrong way, but you should really cooperate with & listen to that host.

    If they're knocking on your door over that, their definately knocking on the doors of others on the server to keep it running smoothly, as opposed to the "thousands of other hosts" who are either letting people run wild killing servers resulting in slow response times, or suspending domains which puts you in the exact same position you're in now.

  9. #9
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    files

    Quote Originally Posted by jessebhunt
    ... The only exception to this was the file "sitesub.php," which I can't seem to find at all. ...
    I would definately make an effort to find this file. I would even ask the host for help if need be. If the site's security has been compromised it would be in their interest as well.

  10. #10
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jessebhunt
    The only exception to this was the file "sitesub.php," which I can't seem to find at all.
    It needn't exist. Since there's an @ in front of include(), it basically says "include this file if it exists - if it doesn't exist, just ignore and proceed."

  11. #11
    SitePoint Addict jessebhunt's Avatar
    Join Date
    Dec 2003
    Location
    Insomnia
    Posts
    278
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by joebert
    Don't take this the wrong way, but you should really cooperate with & listen to that host.

    If they're knocking on your door over that, their definately knocking on the doors of others on the server to keep it running smoothly, as opposed to the "thousands of other hosts" who are either letting people run wild killing servers resulting in slow response times, or suspending domains which puts you in the exact same position you're in now.

    I didn't mean to imply that I don't care what the host thinks. However, he has made it clear that I only have one chance to fix the problem with this site. So, I've tried to fix it. If my fix doesn't work, my only choice will be to host that site with someone else. I will still host many of my other sites with the existing host.





    I've looked pretty extensively for the 'sitesub.php' file. I'm thinking that you must be correct, kyberfabrikken, I don't think it exists.



    Thanks again for all of the advice.

    Regards,
    Now Hiring
    Looking for (x)html coder/ php programmer/
    WordPress expert for project work. PM me with
    your rates and work samples if you're interested.

  12. #12
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    non-existant file

    If you think that sitesub.php doesn't exist, I wouldn't settle for a failure to include error being suppressed. I would remove the include line from your files that include it.

  13. #13
    SitePoint Enthusiast
    Join Date
    Jan 2004
    Location
    NY
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Jesse I would also try using include_once () instead of include(), this would guarantee that the file(s) in question would only be included once no matter how times a script may inadvertently attempt to inlcude it.

  14. #14
    SitePoint Addict jessebhunt's Avatar
    Join Date
    Dec 2003
    Location
    Insomnia
    Posts
    278
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mittineague: I agree... I plan to do that.

    Jynx: That sounds like a good idea too! Will do.

    Thanks for all the help!

    (I'm amazed at how active and helpful the PHP forum of SitePoint is!)

    Thanks again everyone.
    Now Hiring
    Looking for (x)html coder/ php programmer/
    WordPress expert for project work. PM me with
    your rates and work samples if you're interested.


Bookmarks

Posting Permissions

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