After restarting Apache 2.2 with mod_php and letting it run for half an hour or so, PHP stops respecting calls to error_reporting() to alter the current error level. All calls to error_reporting() for the current connection will not update the actual level. This behavior will occur with only *some* of the connections, but not all of them. Reloading the page (after waiting for the keep alive to time out) will sometimes result in the expected behavior, and others will result in the erroneous behavior. As a side effect, this causes all supporting libraries that rely on error suppression, like Smarty, to throw errors. Reproducible: Always Steps to Reproduce: <?php var_dump(error_reporting()); var_dump(error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE)); trigger_error('This should not be seen', E_USER_NOTICE); echo $a; // should cause a notice var_dump(error_reporting()); ?> Actual Results: int(6143) int(6143) <br /> <b>Notice</b>: This should not be seen in <b>/home/gabebug/public_html/error_reporting_tests.php</b> on line <b>5</b><br /> <br /> <b>Notice</b>: Undefined variable: a in <b>/home/gabebug/public_html/error_reporting_tests.php</b> on line <b>6</b><br /> int(6143) Expected Results: int(6143) int(6143) int(5111) $ emerge --info Portage 2.1.3.9 (hardened/x86/2.6, gcc-3.4.6, glibc-2.5-r4, 2.6.20-hardened-r5 i686) ================================================================= System uname: 2.6.20-hardened-r5 i686 Intel(R) Xeon(TM) CPU 3.00GHz Timestamp of tree: Mon, 24 Sep 2007 04:50:01 +0000 app-shells/bash: 3.2_p17 dev-lang/python: 2.3.5-r3, 2.4.4-r5 dev-python/pycrypto: 2.0.1-r6 sys-apps/baselayout: 1.12.9-r2 sys-apps/sandbox: 1.2.17 sys-devel/autoconf: 2.13, 2.61-r1 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10 sys-devel/binutils: 2.17-r1 sys-devel/gcc-config: 1.3.16 sys-devel/libtool: 1.5.24 virtual/os-headers: 2.6.21 ACCEPT_KEYWORDS="x86" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=pentium4 -pipe -O2" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /var/bind /var/qmail/alias /var/qmail/control" CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/php/apache2-php4/ext-active/ /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php4/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php4/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo" CXXFLAGS="-march=pentium4 -pipe -O2" DISTDIR="/usr/portage/distfiles" FEATURES="distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://distro.ibiblio.org/pub/linux/distributions/gentoo/ http://ftp.ucsb.edu/pub/mirrors/linux/gentoo/ http://gentoo.chem.wisc.edu/gentoo/" MAKEOPTS="-j5" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.us.gentoo.org/gentoo-portage" USE="acl apache2 bzip2 chroot cli cracklib crypt ctype curl examples expat gd hardened hpn jpeg midi mpm-prefork multiuser munin-apache mysql nls nptl nptlonly pam pcre pic png posix readline ruby sendfile session sftplogging ssl symlink tcpd threads unicode urandom utf8 vchroot vhosts x86 xml xorg zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="mouse keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS $ cat /etc/php/apache2-php5/php.ini |grep -v \; | grep -v ^$ [PHP] engine = On zend.ze1_compatibility_mode = Off short_open_tag = Off asp_tags = Off precision = 12 y2k_compliance = On output_buffering = Off zlib.output_compression = Off implicit_flush = Off unserialize_callback_func= serialize_precision = 100 allow_call_time_pass_reference = On safe_mode = Off safe_mode_gid = Off safe_mode_include_dir = safe_mode_exec_dir = safe_mode_allowed_env_vars = PHP_ safe_mode_protected_env_vars = LD_LIBRARY_PATH disable_functions = disable_classes = expose_php = Off error_reporting = E_ALL display_errors = On display_startup_errors = Off log_errors = On log_errors_max_len = 1024 ignore_repeated_errors = Off ignore_repeated_source = Off report_memleaks = On track_errors = Off error_log = /var/log/php/5_error_log variables_order = "EGPCS" register_globals = Off register_long_arrays = On register_argc_argv = On auto_globals_jit = On post_max_size = 16M magic_quotes_gpc = Off magic_quotes_runtime = Off magic_quotes_sybase = Off auto_prepend_file = auto_append_file = default_mimetype = "text/html" include_path = ".:/usr/share/php:/usr/lib/php:/usr/local/lib/mis:/usr/local/lib/eclipse" doc_root = user_dir = extension_dir = /usr/lib/php5/lib/php/extensions/no-debug-non-zts-20060613 enable_dl = On file_uploads = On upload_max_filesize = 64M allow_url_fopen = Off allow_url_include = Off default_socket_timeout = 60 [Date] date.timezone = "US/Central" [filter] [iconv] [sqlite] [xmlrpc] [Pcre] [Syslog] define_syslog_variables = Off [mail function] SMTP = localhost smtp_port = 25 [SQL] sql.safe_mode = Off [ODBC] odbc.allow_persistent = On odbc.check_persistent = On odbc.max_persistent = -1 odbc.max_links = -1 odbc.defaultlrl = 4096 odbc.defaultbinmode = 1 [MySQL] mysql.allow_persistent = On mysql.max_persistent = -1 mysql.max_links = -1 mysql.default_port = mysql.default_socket = mysql.default_host = mysql.default_user = mysql.default_password = mysql.connect_timeout = 60 mysql.trace_mode = Off [MySQLi] mysqli.max_links = -1 mysqli.default_port = 3306 mysqli.default_socket = mysqli.default_host = mysqli.default_user = mysqli.default_pw = mysqli.reconnect = Off [mSQL] msql.allow_persistent = On msql.max_persistent = -1 msql.max_links = -1 [OCI8] [PostgresSQL] pgsql.allow_persistent = On pgsql.auto_reset_persistent = Off pgsql.max_persistent = -1 pgsql.max_links = -1 pgsql.ignore_notice = 0 pgsql.log_notice = 0 [Sybase] sybase.allow_persistent = On sybase.max_persistent = -1 sybase.max_links = -1 sybase.min_error_severity = 10 sybase.min_message_severity = 10 sybase.compatability_mode = Off [Sybase-CT] sybct.allow_persistent = On sybct.max_persistent = -1 sybct.max_links = -1 sybct.min_server_severity = 10 sybct.min_client_severity = 10 [bcmath] bcmath.scale = 0 [browscap] [Informix] ifx.default_host = ifx.default_user = ifx.default_password = ifx.allow_persistent = On ifx.max_persistent = -1 ifx.max_links = -1 ifx.textasvarchar = 0 ifx.byteasvarchar = 0 ifx.charasvarchar = 0 ifx.blobinfile = 0 ifx.nullformat = 0 [Session] session.save_handler = files session.save_path = "/var/session" session.use_cookies = 1 session.name = PHPSESSID session.auto_start = 0 session.cookie_lifetime = 0 session.cookie_path = / session.cookie_domain = session.cookie_httponly = session.serialize_handler = php session.gc_probability = 1 session.gc_divisor = 100 session.gc_maxlifetime = 28800 session.bug_compat_42 = 0 session.bug_compat_warn = 1 session.referer_check = session.entropy_length = 0 session.entropy_file = session.cache_limiter = nocache session.cache_expire = 180 session.use_trans_sid = 0 session.hash_function = 0 session.hash_bits_per_character = 4 url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset=" [MSSQL] mssql.allow_persistent = On mssql.max_persistent = -1 mssql.max_links = -1 mssql.min_error_severity = 10 mssql.min_message_severity = 10 mssql.compatability_mode = Off mssql.secure_connection = Off [Assertion] [COM] [mbstring] [FrontBase] [gd] [exif] [Tidy] tidy.clean_output = Off [soap] soap.wsdl_cache_enabled=1 soap.wsdl_cache_dir="/tmp" soap.wsdl_cache_ttl=86400
Which php version is this about?
Apologies for that omission. dev-lang/php-5.2.4_p20070914-r2, built this morning.
This bug occurs in the CVS has been filed upstream at http://bugs.php.net/bug.php?id=42749
*** Bug 193677 has been marked as a duplicate of this bug. ***
Nothing we could fix; marking UPSTREAM.