|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22672 User not logged under Apache2
Submitted: 2003-03-13 03:11 UTC Modified: 2003-03-17 15:31 UTC
From: bugzilla at ab dot thatcow dot com Assigned: ianh (profile)
Status: Closed Package: Apache2 related
PHP Version: 4.3.1 OS: SunOS 5.9
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: bugzilla at ab dot thatcow dot com
New email:
PHP Version: OS:


 [2003-03-13 03:11 UTC] bugzilla at ab dot thatcow dot com
I send headers through PHP to force authentication. Under apache1.3, the username would show up properly under my combined logs - under apache2.0.44, I always see "-". The folks over at Apache (see their bug #8500) suggest PHP needs to be setting user in the request structure.

I've add one line in php_apache_request_ctor() in sapi_apache2.c to set this. This hack is fairly ignorant of the internals of both php and apache, but here it is anyway. Do with as you wish. Forgive the formatting here if it doesn't come out right.

        if (!PG(safe_mode)) {
                auth = apr_table_get(f->r->headers_in, "Authorization");
                php_handle_auth_data(auth TSRMLS_CC);
+               ctx->r->user = apr_pstrdup(ctx->r->pool,SG(request_info).auth_user);
        } else {
                SG(request_info).auth_user = NULL;
                SG(request_info).auth_password = NULL;


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-13 23:18 UTC]
Can you mail me some php script which does user-authentication. so I can test the patch.
I want to verify it works if a user does user-authentication via apache before I commit it.

 [2003-03-14 10:01 UTC]
[To: Ian] Always set the status also to 'Assigned'

 [2003-03-17 15:29 UTC]
Thanks Andrew.
I've commited your patch into the CVS HEAD.
Jani -- are you ok with this going into 4_3 ?

 [2003-03-17 15:31 UTC]
closing this
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 22 07:01:31 2024 UTC