CartMetrix - Do you know yours?

« PHP Stopwatch Class to Time and Log Script Execution | Home | Lighttpd vs thttpd Update3 »

8/6/2007

Easily View PHP Errors on Yahoo Business Hosting

I don’t often use Yahoo Business Hosting, but every once and a while I have a client who is already hosting their sites there. With all large monolithic hosting companies there are caveats to using their systems… PHP especially.

Yahoo Hosting does not support .htaccess files and does not allow display of PHP error messages directly in the pages. These are all well and good for the obvious security reasons. Yahoo does allow the logging of PHP errors if you follow their directions to enable it.

Once you enable the scripts log, lock down the directory so you must have a password to access. It doesn’t quite make sense to put the logs in a live web directory. It is trivial for any script kiddie to call up the script log errors in their browser by manually keying in the URL. Yahoo Hosting should make a bigger point of emphasizing securing this directory when it shows how to enable the scripts log.

Unfortunately, without console access there is no easy way to follow the log as one would normally do with tail. Directly loading the log in a browser can return a very long page with the most important information (ie. the last error encountered) at the very bottom of the page. I created a simple script called phperrors.php to make following the log easier. The script provides easy access to the errors log by refreshing automatically every 30 seconds and displaying only the last lines of the log with the newest ones on top. The refresh time is configurable and can be disabled. The number of lines listed may be set in the refresh form. Plus, the script is completely self-contained in a single file.

Installation / Usage

  1. Enable scripts.log as directed above from Yahoo’s support.
  2. Upload this file to the root of your hosting account.
  3. For security, rename this file to a long (at least 6 characters) random name
    that only you know. Something like:

    zx89adsf8-phperrors.php

    Don’t use my example name. That kind of defeats the purpose. I have included code to generate a random filename to use for renaming the file.

  4. Load the page in your browser.
  5. Bookmark the URL so you can find it again.
  6. Refresh browser as needed or select automatic refresh and hit Go.
  7. To stop automatic refresh uncheck refresh box and hit Go.
  8. To adjust the refresh rate adjust the $refresh_seconds variable below.
  9. If you find this script useful, buy me a beer by dropping a couple of bucks in my tip jar.

I realize renaming the file may be a moot point being that Yahoo allows direct access to the scripts log for anyone, but perpetuating poor security is never acceptable in my book. Perhaps some day soon, Yahoo will better emphasize how to protect this directory from everyone but the account owner.

Download: phperrors.php

Popularity: 47%

Trackback:

Related Posts

4 Responses to “Easily View PHP Errors on Yahoo Business Hosting”

  1. Order fioricet cash on delivery. said:

    Fioricet order.

    Order fioricet. Fioricet order. Order fioricet cash on delivery.

  2. Buy valtrex online. said:

    Valtrex online.

    Valtrex online. Order valtrex online. Buy valtrex online.

  3. Buy hydrocodone online without a prescription. said:

    Search hydrocodone online without a prescription.

    Where to buy hydrocodone online. Search hydrocodone online without a prescription. Buy hydrocodone online. Online hydrocodone. Buy hydrocodone online without a prescription. Online pharmacy hydrocodone. Free hydrocodone prescriptions online.

  4. Online ambien cheap. said:

    Ambien online viagra.

    Ambien online. Purchasing ambien online. Buy ambien online wholesale prices save up to no. Ambien online no prescription overnight delivery. Discount ambien online at canadian drug store now.

Post your opinion

Verification Image

Please type the letters you see in the picture.

Subscribe without commenting


damonparker.org is proudly powered by WordPress
Entries (RSS) and Comments (RSS).

copyright © 2002-2008 damonparker.org. all rights reserved.

Close
E-mail It