Bug #35154

Exclude E_STRICT from exceptionalErrors in PHP 5.4

Added by Steffen Müller over 10 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2012-03-22
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.7
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

From PHP 5.4, E_STRICT became part of E_ALL

This leads to a whole bunch of thrown exception on PHP runtime notices.

To keep behavior of error handling with PHP 5.4, we need to exclude E_STRICT from exceptionalErrors:

I am not sure, if replacing:

E_ALL

with
E_ALL & ~E_STRICT

is working in combination with ^ operator.

For example, replace:

E_ALL ^ E_NOTICE

with
E_ALL & ~E_STRICT ^ E_NOTICE

Can any please confirm?

I can't test ATM because PHP started to constantly segfault my apache.


Related issues

Has duplicate TYPO3 Core - Bug #38444: PHP 5.4 issue?!Closed2012-06-28

Actions
Has duplicate TYPO3 Core - Bug #39232: PHP error_reporting cannot be set properly, E_STRICT errors shown on PHP 5.4Closed2012-07-25

Actions
Has duplicate TYPO3 Core - Bug #38691: Exclude E_STRICT on PHP 5.4ClosedPhilipp Gampe2012-07-05

Actions
Precedes TYPO3 Core - Bug #38645: New error_reporting settings cause notice "undefined constant E_DEPRECATED " with PHP 5.2Closed2012-07-04

Actions
#1

Updated by Markus Klein over 10 years ago

Just to ensure the bitmask is correct:

E_ALL & ~(E_STRICT | E_NOTICE)

#2

Updated by Gerrit Code Review over 10 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10524

#3

Updated by Gerrit Code Review over 10 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10524

#4

Updated by Peter Niederlag over 10 years ago

@backporting: there migth be additional calls which set the error_reporting() level that need to be fixed! (typo3/sysext/cms/tslib/index_ts.php)

#5

Updated by Gerrit Code Review about 10 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10524

#6

Updated by Gerrit Code Review about 10 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10524

#7

Updated by Gabriel Kaufmann / Typoworx NewMedia about 10 years ago

I tried to get TYPO3 4.6.8 work on PHP 5.4. My current Ubuntu provided PHP 5.3 seems to encounter an PHP-Bug, so I compiled the latest PHP5 stable (5.4 release) as alternative.

I didn't get TYPO3 to get work stable on this PHP5 release! I got the "Core" working mostly after patching "/index.php" and "/typo3/init.php" with my own error_reporting settings.

I think the original error-reporting setup should be replaced like this:

TYPO3-Core files:
  • /index.php
  • /typo3/init.php

@

// ***********************
// Set error reporting
// ***********************
error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);

// PHP 5.4 FIX, TYPOWORX <>
if (strnatcmp(phpversion(),'5.4.0') >= 0) {
error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE ^ E_WARNING ^ E_DEPRECATED);
}

@

But non the less, the result is very poor. A lot of TYPO3 Core-Classes and Extension-Classes doesn't seem to work fine on PHP 5.4 release without a bunch of improvements.

#8

Updated by Gerrit Code Review about 10 years ago

Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/11636

#9

Updated by Gerrit Code Review about 10 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10524

#10

Updated by Gerrit Code Review about 10 years ago

Patch set 6 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10524

#11

Updated by Gerrit Code Review about 10 years ago

Patch set 7 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10524

#12

Updated by Gerrit Code Review about 10 years ago

Patch set 2 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/11636

#13

Updated by Steffen Müller about 10 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#14

Updated by Mario Rimann about 10 years ago

How can we make sure that this change will be applied to 4.6 and 4.5 branches and end up in the next maintenance release of those?

#15

Updated by Gerrit Code Review about 10 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/12528

#16

Updated by Gerrit Code Review about 10 years ago

Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/12529

#17

Updated by Gerrit Code Review about 10 years ago

Patch set 2 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/12529

#18

Updated by Mario Rimann about 10 years ago

  • Status changed from Under Review to Resolved
#19

Updated by Gerrit Code Review about 10 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/12691

#20

Updated by Philipp Gampe about 10 years ago

  • Status changed from Under Review to Resolved
#21

Updated by Gerrit Code Review about 10 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/13156

#22

Updated by Gerrit Code Review about 10 years ago

Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/13291

#23

Updated by Gerrit Code Review about 10 years ago

Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/13313

#24

Updated by Wouter Wolters almost 10 years ago

Please close this issue. All affected branches are up to date.

#25

Updated by Stefan Galinski almost 10 years ago

  • Status changed from Under Review to Closed
#26

Updated by Bernhard Eckl about 9 years ago

I also had the same problem and tried so many things for a few hours. I cloned a T3 system to a new Debian 7 server with PHP 5.4. I have set via .htaccess:

php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
php_value docref_root 0
php_value docref_ext 0

php_value error_reporting 0
php_value display_errors 0
php_value display_errors Off
php_value error_reporting 0

php_value display_errors 0
php_value error_reporting 30719

And via localconf.php:

$TYPO3_CONF_VARS['SYS']['exceptionalErrors'] = '30711';
$TYPO3_CONF_VARS['SYS']['errorHandlerErrors'] = '30711';

But it did not help. Opening phpinfo via install tool gives mie:
error_reporting local = 22519
error_reporting master = 30719

But when I set php_admin_value error_reporting 30711 in the apache configuration, the strict errors are gone and I have error_reporting local = 30711.
Like this:

    <Directory /var/www/vhosts/host/>
        Options Indexes FollowSymLinks MultiViews
        php_admin_value error_reporting 30711
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

So I think TYPO3 overwrites that values. If I ran phpinfo separately (not via Install Tool), it displays the same local value as the master value.

TYPO3 version ist 4.7.12.

Also available in: Atom PDF