summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2004-03-16 22:38:17 +0000
committerIlia Alshanetsky <iliaa@php.net>2004-03-16 22:38:17 +0000
commit1b2b9a6a0ddf4feff785ceb97b0ec5d37aac445c (patch)
tree035ba17c7a13794eae12bb66fdd64beddcc4bf76
parenta207ace664727b39e966d1b292a42c67a6d37910 (diff)
downloadphp-git-1b2b9a6a0ddf4feff785ceb97b0ec5d37aac445c.tar.gz
MFH:
Fixed bug #27580 (pre-initialization errors in ap2 handler are not being written to vhost error log). Stop using depreciated and ignored APLOG_NOERRNO directive. Make file not found & directory as script invocation error messages more descriptive.
-rw-r--r--NEWS2
-rw-r--r--sapi/apache2handler/sapi_apache2.c21
2 files changed, 16 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index 8a87d697e0..14f5b98f46 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,8 @@ PHP 4 NEWS
- Fixed bug #27590 (crash during shutdown when freeing persistent resources
in ZTS mode). (Ilia)
- Fixed bug #27582 (possible crashes in imagefilltoborder()). (Pierre)
+- Fixed bug #27580 (pre-initialization errors in ap2 handler are not being
+ written to vhost error log). (Ilia)
- Fixed bug #27559 (Corrected open_basedir resolving logic). (Ilia)
- Fixed bug #27530 (broken http auth when safe_mode is on and PCRE is
disabled). (Ilia)
diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c
index 46f3221322..357248470e 100644
--- a/sapi/apache2handler/sapi_apache2.c
+++ b/sapi/apache2handler/sapi_apache2.c
@@ -53,7 +53,7 @@
/* UnixWare and Netware define shutdown to _shutdown, which causes problems later
* on when using a structure member named shutdown. Since this source
- * file does not use the system call shutdown, it is safe to #undef it.
+ * file does not use the system call shutdown, it is safe to #undef it.K
*/
#undef shutdown
@@ -288,11 +288,18 @@ static void php_apache_sapi_log_message(char *msg)
* with Apache 1.3 -- rbb
*/
if (ctx == NULL) { /* we haven't initialized our ctx yet, oh well */
- ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO | APLOG_STARTUP,
- 0, NULL, "%s", msg);
+ ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_STARTUP, 0, NULL, "%s", msg);
} else {
- ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO | APLOG_STARTUP,
- 0, ctx->r, "%s", msg);
+ ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_STARTUP, 0, ctx->r, "%s", msg);
+ }
+}
+
+static void php_apache_sapi_log_message_ex(char *msg, request_rec *r)
+{
+ if (r) {
+ ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_STARTUP, 0, r, msg, r->filename);
+ } else {
+ php_apache_sapi_log_message(msg);
}
}
@@ -486,14 +493,14 @@ static int php_handler(request_rec *r)
}
if (r->finfo.filetype == 0) {
- php_apache_sapi_log_message("script not found or unable to stat");
+ php_apache_sapi_log_message_ex("script '%s' not found or unable to stat", r);
zend_try {
zend_ini_deactivate(TSRMLS_C);
} zend_end_try();
return HTTP_NOT_FOUND;
}
if (r->finfo.filetype == APR_DIR) {
- php_apache_sapi_log_message("attempt to invoke directory as script");
+ php_apache_sapi_log_message_ex("attempt to invoke directory '%s' as script", r);
zend_try {
zend_ini_deactivate(TSRMLS_C);
} zend_end_try();