Project

General

Profile

Actions

Bug #35154

closed

Exclude E_STRICT from exceptionalErrors in PHP 5.4

Added by Steffen Müller over 12 years ago. Updated over 11 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 4 (0 open4 closed)

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
Actions #1

Updated by Markus Klein over 12 years ago

Just to ensure the bitmask is correct:

E_ALL & ~(E_STRICT | E_NOTICE)

Actions #2

Updated by Gerrit Code Review over 12 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

Actions #3

Updated by Gerrit Code Review over 12 years ago

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

Actions #4

Updated by Peter Niederlag over 12 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)

Actions #5

Updated by Gerrit Code Review over 12 years ago

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

Actions #6

Updated by Gerrit Code Review over 12 years ago

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

Actions #7

Updated by Gabriel Kaufmann / Typoworx NewMedia over 12 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.

Actions #8

Updated by Gerrit Code Review over 12 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

Actions #9

Updated by Gerrit Code Review over 12 years ago

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

Actions #10

Updated by Gerrit Code Review over 12 years ago

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

Actions #11

Updated by Gerrit Code Review over 12 years ago

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

Actions #12

Updated by Gerrit Code Review over 12 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

Actions #13

Updated by Steffen Müller over 12 years ago

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

Updated by Mario Rimann over 12 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?

Actions #15

Updated by Gerrit Code Review over 12 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

Actions #16

Updated by Gerrit Code Review over 12 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

Actions #17

Updated by Gerrit Code Review over 12 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

Actions #18

Updated by Mario Rimann over 12 years ago

  • Status changed from Under Review to Resolved
Actions #19

Updated by Gerrit Code Review over 12 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

Actions #20

Updated by Philipp Gampe over 12 years ago

  • Status changed from Under Review to Resolved
Actions #21

Updated by Gerrit Code Review over 12 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

Actions #22

Updated by Gerrit Code Review over 12 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

Actions #23

Updated by Gerrit Code Review over 12 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

Actions #24

Updated by Wouter Wolters about 12 years ago

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

Actions #25

Updated by Stefan Galinski about 12 years ago

  • Status changed from Under Review to Closed
Actions #26

Updated by Bernhard Eckl over 11 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.

Actions

Also available in: Atom PDF