Questions tagged [fatal-error]

An error that causes a program to abort, regardless of the programming language.

A fatal error causes the program to finish execution, usually returning back to the operating system. This broad category also covers errors that are not thrown as exceptions.

When using this tag, it may be a good idea to add more focused tags like , and the like.

Be sure to leave the language's tag (for example , or ) so others can easily know if they can help you.

2091 questions
599
votes
18 answers

How do I catch a PHP fatal (`E_ERROR`) error?

I can use set_error_handler() to catch most PHP errors, but it doesn't work for fatal (E_ERROR) errors, such as calling a function that doesn't exist. Is there another way to catch these errors? I am trying to call mail() for all errors and am…
too much php
  • 88,666
  • 34
  • 128
  • 138
252
votes
15 answers

Fatal error: Class 'SoapClient' not found

I'm trying a simple web service example and I get this error even though I uncommented extension=php_soap.dll in the php.ini file: Fatal error: Class 'SoapClient' not found in C:\Program Files (x86)\EasyPHP-5.3.9\www\server.php on line 2
Figen Güngör
  • 12,169
  • 14
  • 66
  • 108
182
votes
12 answers

Weird PHP error: 'Can't use function return value in write context'

I'm getting this error and I can't make head or tail of it. The exact error message is: Fatal error: Can't use function return value in write context in /home/curricle/public_html/descarga/index.php on line 48 Line 48 is: if…
cfischer
  • 24,452
  • 37
  • 131
  • 214
176
votes
9 answers

PHP Fatal error: Using $this when not in object context

I've got a problem: I'm writing a new WebApp without a Framework. In my index.php I'm using: require_once('load.php'); And in load.php I'm using require_once('class.php'); to load my class.php. In my class.php I've got this error: Fatal error:…
ahmet2106
  • 4,957
  • 4
  • 27
  • 38
173
votes
19 answers

PHP Fatal error: Cannot redeclare class

Does anyone know what can cause this problem? PHP Fatal error: Cannot redeclare class
Jin Yong
  • 42,698
  • 72
  • 141
  • 187
143
votes
14 answers

Why, Fatal error: Class 'PHPUnit_Framework_TestCase' not found in ...?

Why I'm getting this PHP error? Fatal error: Class 'PHPUnit_Framework_TestCase' not found in ...
Alvin
  • 1,850
  • 4
  • 15
  • 17
119
votes
4 answers

relative path in require_once doesn't work

I have the following structure otsg > class > authentication.php > database.php > user.php > include > config.inc.php > encryption.php > include.php > session.php > index.php > registration.php include.php file has the…
user525146
  • 3,918
  • 14
  • 60
  • 103
100
votes
1 answer

How can I catch a "catchable fatal error" on PHP type hinting?

I am trying to implement Type Hinting of PHP5 on one of my class, class ClassA { public function method_a (ClassB $b) {} } class ClassB {} class ClassWrong{} Correct usage: $a = new ClassA; $a->method_a(new ClassB); producing error: $a =…
hoball
  • 3,146
  • 5
  • 23
  • 15
86
votes
5 answers

How to correct `git` reporting `detected dubious ownership in repository` without adding `safe.directory` when using WSL?

I used git for the last few years in this context: Host = my laptop, windows. WSL enabled Repos live in the Linux side. I access them both from the Linux and the Windows side. I can access the files in Linux either via git-bash like this (via the…
Xavi Montero
  • 9,239
  • 7
  • 57
  • 79
85
votes
9 answers

PHP Notice: Undefined offset: 1 with array when reading data

I am getting this PHP error: PHP Notice: Undefined offset: 1 Here is the PHP code that throws it: $file_handle = fopen($path."/Summary/data.txt","r"); //open text file $data = array(); // create new array map while (!feof($file_handle) ) { …
alchuang
  • 3,487
  • 3
  • 34
  • 48
81
votes
8 answers

How to catch the fatal error: Maximum execution time of 30 seconds exceeded in PHP

I've been playing around with a system I'm developing and managed to get it to cause this: Fatal error: Maximum execution time of 30 seconds exceeded It happened when I was doing something unrealistic, but nevertheless it could happen with a…
ingh.am
  • 25,981
  • 43
  • 130
  • 177
72
votes
13 answers

Broken branch in git, fatal: your current branch appears to be broken

Here is my case: I was working on one branch. Pushed new commits to the remote. Switched back to the master branch. But suddenly after typing git checkout master command my computer encountered blue screen of death and an unexpected force shut…
Suresh Karia
  • 17,550
  • 18
  • 67
  • 85
67
votes
6 answers

PHP : Custom error handler - handling parse & fatal errors

How can i handle parse & fatal errors using a custom error handler?
A.N.M. Saiful Islam
  • 2,118
  • 5
  • 28
  • 34
66
votes
7 answers

PHP Fatal error: Cannot access empty property

I'm new to php and I have executed below code. my_value[] = $value; } function set_value ($value){ // Error occurred from here as…
Bishan
  • 15,211
  • 52
  • 164
  • 258
63
votes
3 answers

Should a Go package ever use log.Fatal and when?

I have so far avoided use of log.Fatal, but I recently co-incidentally discovered these questions; code-coverage and tests-using-log-fatal. One of the comments from the 100 code coverage questions says: ... In the vast majority of cases…
miltonb
  • 6,905
  • 8
  • 45
  • 55
1
2 3
99 100