Skip to content

Commit 09237f6

Browse files
ericnorrisbukka
authored andcommitted
Update request startup error messages
1 parent 7aadbcb commit 09237f6

12 files changed

+25
-23
lines changed

NEWS

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ PHP NEWS
1616
. Fixed bug GH-8995 (WeakMap object reference offset causing TypeError).
1717
(Tobias Bachert)
1818
. Added error_log_mode ini setting. (Mikhail Galanin)
19+
. Updated request startup messages. (Eric Norris)
1920

2021
- COM:
2122
. Fixed bug GH-8750 (Can not create VT_ERROR variant type). (cmb)

ext/imap/tests/bug46918.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ array (
6868
'host' => '.SYNTAX-ERROR.',
6969
),
7070
)
71-
Notice: Unknown: Unexpected characters at end of address: @two (errflg=3) in Unknown on line 0
71+
Notice: PHP Request Shutdown: Unexpected characters at end of address: @two (errflg=3) in Unknown on line 0

ext/imap/tests/imap_open_error.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ Warning: imap_open(): Couldn't open stream in %s on line %d
3636
imap_open(): Argument #4 ($flags) must be a bitmask of the OP_* constants, and CL_EXPUNGE
3737
imap_open(): Argument #5 ($retries) must be greater than or equal to 0
3838

39-
Notice: Unknown: Can't open mailbox : no such mailbox (errflg=2) in Unknown on line 0
39+
Notice: PHP Request Shutdown: Can't open mailbox : no such mailbox (errflg=2) in Unknown on line 0

ext/mbstring/tests/bug63447_001.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ a=1&b=2&c=3&d=4&e=5&f=6
1313
var_dump($_POST);
1414
?>
1515
--EXPECT--
16-
Warning: Unknown: Input variables exceeded 5. To increase the limit change max_input_vars in php.ini. in Unknown on line 0
16+
Warning: PHP Request Startup: Input variables exceeded 5. To increase the limit change max_input_vars in php.ini. in Unknown on line 0
1717
array(0) {
1818
}

ext/mbstring/tests/bug63447_002.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ a=1&b=2&c=3&d=4&e=5
1313
var_dump($_POST);
1414
?>
1515
--EXPECT--
16-
Warning: Unknown: Input variables exceeded 4. To increase the limit change max_input_vars in php.ini. in Unknown on line 0
16+
Warning: PHP Request Startup: Input variables exceeded 4. To increase the limit change max_input_vars in php.ini. in Unknown on line 0
1717
array(0) {
1818
}

ext/session/tests/bug60634_error_3.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ Stack trace:
5252
#1 {main}
5353
thrown in %s on line %d
5454

55-
Warning: Unknown: Cannot call session save handler in a recursive manner in Unknown on line 0
55+
Warning: PHP Request Shutdown: Cannot call session save handler in a recursive manner in Unknown on line 0

ext/session/tests/bug60634_error_4.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ Stack trace:
5252
#1 {main}
5353
thrown in %s on line %d
5454

55-
Warning: Unknown: Cannot call session save handler in a recursive manner in Unknown on line 0
55+
Warning: PHP Request Shutdown: Cannot call session save handler in a recursive manner in Unknown on line 0

ext/session/tests/rfc1867_sid_invalid.phpt

+6-6
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@ session_destroy();
5252
@unlink(__DIR__ . DIRECTORY_SEPARATOR . "rfc1867_sid_invalid.post.txt");
5353
?>
5454
--EXPECTF--
55-
Warning: Unknown: Session ID is too long or contains illegal characters. Only the A-Z, a-z, 0-9, "-", and "," characters are allowed in Unknown on line 0
55+
Warning: PHP Request Startup: Session ID is too long or contains illegal characters. Only the A-Z, a-z, 0-9, "-", and "," characters are allowed in Unknown on line 0
5656

57-
Warning: Unknown: Failed to read session data: files (path: ) in Unknown on line 0
57+
Warning: PHP Request Startup: Failed to read session data: files (path: ) in Unknown on line 0
5858

59-
Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0
59+
Warning: PHP Request Startup: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0
6060

61-
Warning: Unknown: Session ID is too long or contains illegal characters. Only the A-Z, a-z, 0-9, "-", and "," characters are allowed in Unknown on line 0
61+
Warning: PHP Request Startup: Session ID is too long or contains illegal characters. Only the A-Z, a-z, 0-9, "-", and "," characters are allowed in Unknown on line 0
6262

63-
Warning: Unknown: Failed to read session data: files (path: ) in Unknown on line 0
63+
Warning: PHP Request Startup: Failed to read session data: files (path: ) in Unknown on line 0
6464

65-
Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0
65+
Warning: PHP Request Startup: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0
6666
string(%d) ""
6767
bool(true)
6868
array(2) {

ext/session/tests/session_set_save_handler_iface_002.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,4 @@ bool(true)
8989
session_set_save_handler(): Argument #1 ($open) must be of type SessionHandlerInterface, MySession2 given
9090
good handler writing
9191

92-
Deprecated: Unknown: Session callback must have a return value of type bool, int returned in Unknown on line 0
92+
Deprecated: PHP Request Shutdown: Session callback must have a return value of type bool, int returned in Unknown on line 0

main/main.c

+8-7
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,8 @@ PHPAPI ZEND_COLD void php_verror(const char *docref, const char *params, int typ
965965
function = "PHP Startup";
966966
} else if (php_during_module_shutdown()) {
967967
function = "PHP Shutdown";
968+
} else if (PG(during_request_startup)) {
969+
function = "PHP Request Startup";
968970
} else if (EG(current_execute_data) &&
969971
EG(current_execute_data)->func &&
970972
ZEND_USER_CODE(EG(current_execute_data)->func->common.type) &&
@@ -995,14 +997,13 @@ PHPAPI ZEND_COLD void php_verror(const char *docref, const char *params, int typ
995997
default:
996998
function = "Unknown";
997999
}
1000+
} else if ((function = get_active_function_name()) && strlen(function)) {
1001+
is_function = 1;
1002+
class_name = get_active_class_name(&space);
1003+
} else if (EG(flags) & EG_FLAGS_IN_SHUTDOWN) {
1004+
function = "PHP Request Shutdown";
9981005
} else {
999-
function = get_active_function_name();
1000-
if (!function || !strlen(function)) {
1001-
function = "Unknown";
1002-
} else {
1003-
is_function = 1;
1004-
class_name = get_active_class_name(&space);
1005-
}
1006+
function = "Unknown";
10061007
}
10071008

10081009
/* if we still have memory then format the origin */

sapi/cgi/tests/bug69487.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ var_dump(isset($_POST['foo']));
1111
var_dump(strlen(file_get_contents('php://input')));
1212
?>
1313
--EXPECT--
14-
Warning: Unknown: Unable to create temporary file, Check permissions in temporary files directory. in Unknown on line 0
14+
Warning: PHP Request Startup: Unable to create temporary file, Check permissions in temporary files directory. in Unknown on line 0
1515

16-
Warning: Unknown: POST data can't be buffered; all data discarded in Unknown on line 0
16+
Warning: PHP Request Startup: POST data can't be buffered; all data discarded in Unknown on line 0
1717
bool(false)
1818
int(0)

tests/basic/025.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ a=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1111
var_dump($_POST, $HTTP_RAW_POST_DATA);
1212
?>
1313
--EXPECTF--
14-
Warning: Unknown: POST Content-Length of 2050 bytes exceeds the limit of 1024 bytes in Unknown on line 0
14+
Warning: PHP Request Startup: POST Content-Length of 2050 bytes exceeds the limit of 1024 bytes in Unknown on line 0
1515

1616
Warning: Undefined variable $HTTP_RAW_POST_DATA in %s on line %d
1717
array(0) {

0 commit comments

Comments
 (0)