Answers for "php error log"

PHP
20

enable error logging php

ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);
Posted by: Guest on September-08-2020
1

php set error log file

ini_set("log_errors", 1); // Enable error logging
ini_set("error_log", "/tmp/php-error.log"); // set error path
error_log( "Hello, errors!" ); // log a test error
Posted by: Guest on July-31-2021
1

php error log

/usr/local/apache/logs/error_log
Posted by: Guest on April-21-2020
0

php error log

// Php Error Log
error_log("Error message");

// Log and Array
error_log( print_r( [
  __METHOD__,
  'error_key_1' => 'error_value'
] ) );
Posted by: Guest on August-10-2021
0

output to log file and error to log error

./ShellFile.sh >& pathToLogFile.log
Posted by: Guest on November-19-2020
-1

error php

// how to display php errors on your browser : 
// first step, create an error function : 

$errors = array();

// now you have just to insert the function like this : 

if (........){
  $errors['the_name_of_the_error']='the error message';
}

// example : 
// we want to display an error when the user does not correctly fill, 
// in the 'password' box when registering on your website : 

if(empty($_POST['password']) ||
   $_POST['password'] != $_POST['password_confirm']){
	$errors['errors']= "You must enter a valid password";
}
Posted by: Guest on April-26-2020

Browse Popular Code Answers by Language