cvs: php-src /sapi/apache2handler sapi_apache2.c
| From: | Ilia Alshanetsky | Date: | Tue, 16 Mar 2004 22:38:08 +0000 |
| Subject: | cvs: php-src /sapi/apache2handler sapi_apache2.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-26684@lists.php.net to get a copy of this message | ||
iliaa Tue Mar 16 17:38:08 2004 EDT
Modified files:
/php-src/sapi/apache2handler sapi_apache2.c
Log:
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.
http://cvs.php.net/diff.php/php-src/sapi/apache2handler/sapi_apache2.c?r1=1.37&r2=1.38&ty=u
Index: php-src/sapi/apache2handler/sapi_apache2.c
diff -u php-src/sapi/apache2handler/sapi_apache2.c:1.37
php-src/sapi/apache2handler/sapi_apache2.c:1.38
--- php-src/sapi/apache2handler/sapi_apache2.c:1.37 Sun Mar 7 22:15:45 2004
+++ php-src/sapi/apache2handler/sapi_apache2.c Tue Mar 16 17:38:07 2004
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sapi_apache2.c,v 1.37 2004/03/08 03:15:45 iliaa Exp $ */
+/* $Id: sapi_apache2.c,v 1.38 2004/03/16 22:38:07 iliaa Exp $ */
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
@@ -55,7 +55,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
@@ -283,11 +283,18 @@
* 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);
}
}
@@ -481,14 +488,14 @@
}
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();