I was working with a client a few months back who was trying to install and configure osCommerce on a GoDaddy hosted web site. I've set up osCommerce in the past and we decided to utilize the AIM (Advanced Integrated Method) API to talk to their Authorize.net account. osCommerce has some great contribution modules including this particular AIM module. Usually, this is a piece of cake to install and configure. All that is normally needed to do is to log into the administration area, activate the module and supply API credentials and you're in business. But of course, nothing is easy. After installing the module and testing the check out process, the application would hang and then eventually fail. After double and triple checking my configuration settings, I was wondering if there was something else wrong. Usually long 'hangs' are a possible indicator of a network connection issue. After some digging, I discovered that GoDaddy does things a little differently than the rest of the world. They include a proxy server in the mix, so that was the key to getting a proper connection. Bookmark to:
How-To for developing and incorporating your own error handling for PHP
This article will describe how you can handle and control errors on your web applications. When errors occur this means that the application has encountered something unexpected. These can be a innocent and easy to correct, but others can severely compromise your server's security if not corrected and addressed properly. By default, everyone should NOT be showing error messages to the public on a production web server. With some simple Apache configurations this can easily be implemented. Below are a few Apache configurations that you could set. Either set this in httpd.conf, vhost.conf or if server permissions are allowed, can also be set in a .htaccess file under the web root.
php_flag log_errors On
php_value error_reporting 2047
php_flag track_errors On
php_flag track_vars On
php_admin_value display_errors Off
This by itself will just present the user with a white screen, which is not ideal to the user's experience. What this article will teach is how to set up error handling that will catch the error, send the user to a 'Error' page and email you the error along with variable information that might help aide in debugging the problem.
To do this, we're going to focus on set_error_handler() function. PHP.net defines it:
This function can be used for defining your own way of handling errors during runtime, for example in applications in which you need to do cleanup of data/files when a critical error happens, or when you need to trigger an error under certain conditions (using trigger_error()).
Bookmark to:
