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
- Enable scripts.log as directed above from Yahoo’s support.
- Upload this file to the root of your hosting account.
- For security, rename this file to a long (at least 6 characters) random name
that only you know. Something like:zx89adsf8-phperrors.phpDon’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.
- Load the page in your browser.
- Bookmark the URL so you can find it again.
- Refresh browser as needed or select automatic refresh and hit Go.
- To stop automatic refresh uncheck refresh box and hit Go.
- To adjust the refresh rate adjust the $refresh_seconds variable below.
- 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%



April 30th, 2008 at 10:32 pm
Fioricet order.
Order fioricet. Fioricet order. Order fioricet cash on delivery.
May 1st, 2008 at 6:55 am
Valtrex online.
Valtrex online. Order valtrex online. Buy valtrex online.
May 1st, 2008 at 7:03 pm
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.
May 2nd, 2008 at 7:07 am
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.