Showing posts with label errors. Show all posts
Showing posts with label errors. Show all posts

Friday, April 27, 2012

How A Single Missing File (404) Can Saturate Your Bandwidth Limits

Most next generation web applications use custom 404 pages to help reduce bounce rates. It can be used as a tool to recommend alternative places to go to in case a file you are looking for is suddenly missing. This perfectly makes sense in the UX perspective. However, with a small mishap like someone accidentally misspelled the image reference or so, it can easily become a recipe for disaster and consume ALL your bandwidth.


Sunday, May 29, 2011

Exceptions Defined - Errors vs Exceptions in PHP

Continued From Here

An EXCEPTION is also a PHP fatal ERROR which similarly, halts the entire program when encountered. However, it is meant to be thrown for exceptional conditions only, that the PHP engine itself cannot control. These are mostly WIRING issues and/or PROGRAM ERRORS with external resources and elements i.e file permissions, connection to database management systems and other external I/O that PHP has little or nothing to do about and expects them to be simply working all the time.

The same assumption that resource or element should always be working is also true in reverse. That a fatal error or an EXCEPTION, either coming from a wiring error or program error, associated with an external resource or element, can or will also happen anytime. It is because of this "exceptional" condition that it can either be working and not working which PHP has nothing to do or can do nothing about implicitly that we call such occurrences as EXCEPTIONS. It is therefore logically correct that when an EXCEPTION is encountered, it should then be catchable and handled so that an alternative code can be run (i.e retry a connection attempt). The try-catch block is specifically meant/built for that reason.

Friday, October 29, 2010

Permission denied: /your/home/dir pcfg_openfile: unable to check htaccess file, ensure it is readable

I was creating a virtual host configuration for an Apache Server, running in CentOS 5, in a method I usually do, which I am almost certain would usually work until I got this dreaded 403 page.

The VHOST configuration:
<virtualhost *:80="">
    ServerAdmin webmaster@dev.somesite.com
    DocumentRoot "/var/local/somesite/public"
    ServerName dev.somesite.com
    ErrorLog logs/somesite.com-error_log
    CustomLog logs/somesite.com-access_log common
    <directory local="" public="" somesite="" var="">
        Options FollowSymLinks
        Allow from all
        AllowOverride all
    </directory>
</virtualhost>

Thursday, June 3, 2010

Errors vs Exceptions - Definition and Proper Usage for PHP

It is often a confusion for both seasoned and new developers when to properly use an exception handler or an error handler. Sometimes these two are either wrongly understood or used interchangeably. In this article, I will try to provide as much simply insight how they are define and when to use them, particularly in this segment, for PHP.