In PHP language checking the logs and checking error is sometimes became difficult.
PHP is offer inbuild solution to log all errors to a log fiie.
First I will tell about creating the normal error log file.
Open your pho.ini file and modify the following line.
error_log = /var/log/php-error.log
Make sure display_errors set to Off (no errors to end users)
display_errors = Off
This is normal way to check the php error log.
But if you want to check where is script is dying or you want to debug.
Then use trigger_error() function. Personaly I love to use this function for logging the php errors.
Using this function you can specify the custom error messages as per your script requirement.
<?php
$test = ture;
if ($test == true) {
trigger_error("A custom error has been triggered");
}
?>
When you run this file and check the php error log file or you can check httpd/apache error log file.
you will got following error message.
Notice: A custom error has been triggered
in C:\webfolder\test.php on line 5
Incoming search terms:
- php trigger_error
- wordpress trigger_error
- apache logs ei=
- output error trigger problem in wordpress
- php errors log test
- drupal using trigger_error
- drupal trigger_error
- php trigger_error в лог
- set wordpress to write to a log file
- wordpress not logging php
- php test error logging






Pingback: Tweets that mention how to log the php error in log file with trigger_error | Wordpressapi.com - Developer Code book -- Topsy.com
That is nice to definitely find a site where the blogger knows what they are talking about.
I learned something from this important post. That is the way, I want to thank you.
http://soft-7.com
Great post. Stumbled!
Hi – I would like to say thank you for an interesting post about a subject I have had an interest in for a while now. I have been lurking and reading the comments avidly so just wanted to express my thanks for providing me with some very good reading material. I look forward to more, and taking a more proactive part in the discussions here, whilst learning too!!
Hi. I read a few of your other posts and wanted to know if you would be interested in exchanging blogroll links?
It is obvious that you love doing what you do as your excitement can be seen in all your work. Don’t ever let the passion die as we are here always looking forward to what you have in store for us. Thanks for your readiness to share your astonishing masterpieces.
You write very detailed,Pay tribute to you.Couldn’t be written any better. Reading this post reminds me of my old room mate! He always kept talking about this. I will forward this article to him. Pretty sure he will have a good read. Thanks for sharing!
found your site on del.icio.us today and really liked it.. i bookmarked it and will be back to check it out some more later ..
There exists certainly a lot to understand about this. I feel you designed some excellent things in Capabilities also.
I find myself coming to your blog more and more often to the point where my visits are almost daily now!
$test=ture? urm wat?
Intriguing post. I have been searching for some good resources for solar panels and discovered your blog. Planning to bookmark this one!
Hello, this is my first time i visit here. I found so many interesting in your blog especially on how to determine the topic. keep up the good work.
Of course, what a great site and informative posts, I will add backlink – bookmark this site? Regards, Reader