Detecting errors and bottlenecks

In this php tutorial I'll teach different ways to detect errors and bottlenecks in PHP projects.

Related Topics
Ads:

PHP Debugging
Ok, so quite a lot of newbies to PHP commonly get syntax errors. I'm just going to post a few commonly known errors, failed remedies and the proper resorts to these errors.


Display errors on screen even with display errors = off with PHP
Sometimes we work with shared hostings, without access to error_log file. With this script we will see how to display errors on screen even with display_errors = Off.


Handling errors
As coders, I'm sure we all know the value of good error handling. So I thought a quick post about how Codeigniter deals with those pesky errors would be a good post. The way I see it, there are 2 types of errors we have to work with. The ones which are displayed out in nice friendly text to your users, and the type which are hidden and shown only to you as the coder to figure out where something has gone wrong.


Logging errors with PHP
PHP has several settings for logging errors; in this post I will look at the log_errors and error_log settings which control whether errors should be logged and where to.


Replace error reporting with exception handlers
As part of a series of posts about PHP exception handling, this post looks at how to make regular errors use exception model. Normally only the newer object-oriented extensions throw exceptions but it is possible to make all errors throw an exception instead using set_error_handler.


A HOWTO on Optimizing PHP
PHP is a very fast programming language, but there is more to optimizing PHP than just speed of code execution. In this chapter, we explain why optimizing PHP involves many factors which are not code related, and why tuning PHP requires an understanding of how PHP performs in relation to all the other subsystems on your server, and then identifying bottlenecks caused by these subsystems and fixing them. We also cover how to tune and optimize your PHP scripts so they run even faster.


Error Handling
Every website will encounter errors from time to time. Most sites will not have any error handling in place and the visitor will most likely receive a cryptic programming error. This can turn visitors away as they don't know what is happening. The way around this is to provide some error handling in your scripts. By testing for errors at crucial stages (e.g accessing a database) you can provide a friendly error message for the user. This tutorial will show you how the error handling functions for the LATEdownload v2 script have been written and how you can use them in your own site.


Debugging your Code
Finding errors in your code by enabling PHP error reporting.


Capitalize First Word of Each Sentence
While the grammatical errors can't be solved, you can use PHP to correct sentence casing and capitalize the first word of each sentence. An ideal place to use it is when you detect yelling and want to make the use data look clean.


Backtracing
If you need to debug a PHP script but do not have debugging tools at hand in your IDE or similar, an easy way to try to see what's happening and what functions are being called is to use PHP's backtracing tools. It can be useful also to include a backtrace when sending or logging errors that have occured on a production website.


How to use try catch PHP Exceptions to make your Code more Stable
Creating an MVC Framework from scratch has helped me realize just how important it is to have mechanisms in place that will help you deal with errors or unexpected output. If your script accepts input from a user or a third party script, rest assured your script will have to deal with bad data, no matter how unlikely that is.


Getting Started with Drizzle
Drizzle is a new, lightweight fork of MySQL specifically designed for cloud applications. Although Drizzle is still under development, it's attracting a lot of attention from developers around the world. This article introduces you to Drizzle and shows you how to use the Drizzle PHP extension to perform queries, retrieve result sets and handle errors in your Drizzle+PHP application.


Create social bookmarks
Social bookmarks is a thing you must have on your website if you want to increase the number of your returning visitors. More and more people rely on sites like del.icio.us or ma.gnolia.com to store their bookmarks. I use it too. It's safer this way. Why should I store my valuable bookmarks on my hard disk when I change my system at almost every 2 months due to viruses, errors or who knows what other reason. I always lose something.


PHP Connections and Query Execution
A collection of 18 FAQs on connecting MySQL server with PHP scritps. Clear explanations and tutorial exercises are provided on MySQL server connection; providing port number, user account and password; selecting or creating database; running SQL statements; checking execution errors.


How to Add Live Comment Preview to Comment Textarea without Plugin
The comment live preview feature helps the comment writer to see what they are writing in the comment form as they write. This feature works well to help prevent errors in spelling and grammar by giving the user a chance to see what they are writing before they post their comment.


Introduction to Debugging and Error Checking
Debugging essentially means to track down an error in your code. Found a "bug" in your code? Then you need to "de-bug" it. This article will introduce you to some basic concepts such as error checking and built-in functions like var_dump() that will aid you in tracking down errors in your PHP applications.


Create a php upload script with basic security
In this tutorial you will learn how to create a php upload script with basic security. You will also learn to pay attention to specific parts of the upload form to help you out when debugging errors.


My website is slow - what can I do?
You are working with a website. The website works. All is perfect but your clients told you its very slow. You must face the problem and improve the behaviour of the web site. But remember all site works properly. There isn't any errors. The common way to resolve problems (understand the problem, reproduce the problem in test environment, solve the problem) doesnt fit in this scenario. What can we do? I want to give some recommendations to improve performance problems in this post.


Querying Web Databases
We introduce the following techniques in this tutorial:
* Using the five-step web database querying approach to develop database-driven queries
* Coding a simple solution to produce HTML <pre> preformatted text
* Using the MySQL library functions for querying databases
* Handling MySQL DBMS errors
* Producing formatted output with the HTML <table> environment
* Using include files to modularize database code
* Adding multiple queries to a script and consolidating the results into one HTML presentation environment
* Performing simple calculations on database data
* Developing basic database-driven scripts incrementally and producing modular code encapsulated in functions.