Blog Tricks

Best two and easy methods to find and monitor PHP errors

Monitor PHP errors

Monitor PHP errors

A genius; Rasmus Lerdorf, created a server-side scripting language for website development in 1994. Who knew that after all these years a time would come that this project would become so famous that by the start of 2013 it would be used in making nearly 240 million websites.

Yes we are talking about none other than the PHP language, better known as PHP: Hypertext Pre-processor nowadays. Now this work holds much significance when it comes to the internet business. Apart from web development this project is also used as a programming language.

So for web-enthusiasts all around the world we would like to inform about some tricks and tips regarding the usage of this language and how to monitor PHP erros. Dealing and monitor PHP errors is very important when operating a website. These errors may be caused by a little customization in server configuration, database setup or files of the site.

On the dark side failing to treat and monitor PHP errors may result in working issues of the site, bandwidth loss and it can also make your site prone to hack-attacks. So for being informed of the ways to treat these errors you should follow either of the following methods.

Method 1 : Error Logging via the WordPress configuration file

Make a”php-errors.log” file that would acts as a station for keeping record of all the errors. Enable the most accurate access permissions for the server to perfectly use this file for writing errors. Place the file before the root directory as this is suitable for safe-guarding the site. When this is done record the directory path and precede to the last step.

Afterwards locate your WordPress directory file “wp-config.php” and quickly add the following code before the finishing line. Once done change the third line with the correct directory path to the error log file created before.

All the work is done and now you have got a complete page to view and monitor PHP errors and solve the issues as soon as possible to maximize the performance of your website. Lastly, this method is best suitable for WordPress generated websites.

Monitor PHP errors : Error Logging via the PHP initiation file

In this method we will require access to the “php.ini” file of the website for the perfect implementation of this method. Also by this accessibility the method would work for any website; be it WordPress generated or any other. Starting off the first step to monitor PHP errors is same as the one in previous method, i.e. create a “php-errors.log” file for having a place to put in errors.

Next up the part to monitor PHP errors is that different is reaching out to your initiation file and adding the following code. Once done, like before mention your error log directory path and you are good to do. Hope the article proved a good guide for PHP error managing.

Also Read : How to secure your blog using Joomla security extensions

Click to comment
To Top