Click here to Skip to main content
15,919,931 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
QuestionHow do you get country dialling code from a mobile phone number? Pin
Marc Firth24-Sep-09 23:32
Marc Firth24-Sep-09 23:32 
AnswerRe: How do you get country dialling code from a mobile phone number? Pin
fly90425-Sep-09 0:46
fly90425-Sep-09 0:46 
GeneralRe: How do you get country dialling code from a mobile phone number? Pin
Marc Firth25-Sep-09 0:50
Marc Firth25-Sep-09 0:50 
Questionoption 'explicit' for php Pin
Jeffrey Webster23-Sep-09 9:37
Jeffrey Webster23-Sep-09 9:37 
AnswerRe: option 'explicit' for php Pin
fly90423-Sep-09 11:44
fly90423-Sep-09 11:44 
AnswerRe: option 'explicit' for php Pin
Marc Firth23-Sep-09 22:32
Marc Firth23-Sep-09 22:32 
GeneralRe: option 'explicit' for php Pin
Jeffrey Webster24-Sep-09 11:33
Jeffrey Webster24-Sep-09 11:33 
GeneralRe: option 'explicit' for php Pin
fly90424-Sep-09 13:51
fly90424-Sep-09 13:51 
Jeffrey Webster wrote:
Or should I be editing the php config file directly?


Edit the 'error_reporting' line (or add it) to your php.ini file to look like the following:
error_reporting = E_ALL
Then restart your web server.


I would suggest creating your own custom error handler. The following example simply logs the error into a file storing what file the error occurred, what line it happened, the message given and dumps the variables currently stored in the symbol table.

<?php

// This function will be called for every error that occurs
function errorHandler($type, $message, $file, $line, $symboltable)
{

	// Log all errors in a file (New line at the end is deliberate)
	error_log('ERROR in ' . $file . ' on line ' . $line . ' - ' . $message . ' [var dump] ' . print_r($symboltable, true) . '
', 3, 'errors.log');
	
	// If fatal error, die() as there is no use to carry on.
	if ($type == E_USER_ERROR)
	{
		die( $message );
	}

	// Alert the user that an error has occurred.
	echo 'An error has occurred, sorry for the inconvenience.';

	// Return true so that it doesn't execute the internal PHP error handler.
	return true;

}

// Report all errors. Unnecessary if it is enabled in the php.ini.
error_reporting(E_ALL);

// Define custom handler.
set_error_handler('errorHandler');

?>


More options of what you can do the error_log() function can do, such as email, write to the system logger etc., can be found in the documentation[^].

If at first you don't succeed, you're not Chuck Norris.

GeneralRe: option 'explicit' for php Pin
Marc Firth24-Sep-09 22:55
Marc Firth24-Sep-09 22:55 
AnswerRe: option 'explicit' for php Pin
Vasudevan Deepak Kumar25-Sep-09 2:09
Vasudevan Deepak Kumar25-Sep-09 2:09 
QuestionDownload a file from a link? [modified] Pin
huh123422-Sep-09 19:38
huh123422-Sep-09 19:38 
AnswerRe: Download a file from a link? Pin
enhzflep22-Sep-09 23:05
enhzflep22-Sep-09 23:05 
GeneralRe: Download a file from a link? Pin
huh123423-Sep-09 18:41
huh123423-Sep-09 18:41 
AnswerRe: Download a file from a link? Pin
fly90423-Sep-09 1:46
fly90423-Sep-09 1:46 
AnswerRe: Download a file from a link? Pin
Marc Firth23-Sep-09 1:54
Marc Firth23-Sep-09 1:54 
AnswerRe: Download a file from a link? Pin
huh123423-Sep-09 17:39
huh123423-Sep-09 17:39 
QuestionWeb pages do not display Pin
Steve Holdorf20-Sep-09 5:47
Steve Holdorf20-Sep-09 5:47 
AnswerRe: Web pages do not display Pin
Steve Holdorf20-Sep-09 7:40
Steve Holdorf20-Sep-09 7:40 
GeneralRe: Web pages do not display Pin
Marc Firth28-Sep-09 5:58
Marc Firth28-Sep-09 5:58 
QuestionAnti Frame Breaker Code Pin
stambekar18-Sep-09 1:31
stambekar18-Sep-09 1:31 
AnswerRe: Anti Frame Breaker Code Pin
enhzflep18-Sep-09 5:35
enhzflep18-Sep-09 5:35 
GeneralRe: Anti Frame Breaker Code Pin
stambekar20-Sep-09 19:15
stambekar20-Sep-09 19:15 
GeneralRe: Anti Frame Breaker Code [modified] Pin
enhzflep22-Sep-09 18:24
enhzflep22-Sep-09 18:24 
QuestionPython Debugger? [modified] Pin
Joe Woodbury16-Sep-09 11:22
professionalJoe Woodbury16-Sep-09 11:22 
AnswerRe: Python Debugger? Pin
Med7at24-Sep-09 18:51
Med7at24-Sep-09 18:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.