php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4223 PHP calls MySQL with apache user instead of connected user
Submitted: 2000-04-24 03:04 UTC Modified: 2002-05-26 13:40 UTC
From: louis at sitebysite dot nl Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 4.0 Release Cand OS: RedHat 6.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: louis at sitebysite dot nl
New email:
PHP Version: OS:

 

 [2000-04-24 03:04 UTC] louis at sitebysite dot nl
This is hard to reproduce, but every once in a while PHP tries to use the
user running apache instead of the user specified in mysql_pconnect() to
query MySQL.  So after a pconnect with user X, you get a "access denied
for user www" from the query. Our config is a dual-processor webserver
and dual-processor MySQL machine.  With low traffic, it does not occur.  
It also appears to occur only when using write locks on tables, but I 
can't positively verify that - only that I haven't seen it happen on sites
not using table locks, yet.

PHP configured with:
./configure --with-apxs=/usr/local/apache/bin/apxs --with-mysql=/usr --enable-track-vars --with-gd=../gd1.4 --with-ttf --without-pcre-regex --with-mm=../mm-1.0.12 --enable-inline-optimization --disable-debug --with-recode --with-t1lib --with-dbase

Also running the Zend optimizer for RC1.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-30 13:52 UTC] zak@php.net
** Warning - uneducated guess **

This seems like it might be a mysql configuration issue.

Please review the MySQL documentation on performance - try increasing the max number of connections, etc...

Also, what user does you web server run as - www by chance?
 [2000-07-30 17:07 UTC] zak@php.net
User response:
"As far as I can gather it has something to do with the
wait_timeout of MySQL.  This was set pretty low.  I think
the persistent connections outlived the connections on the
database side during quiet periods.  The error doesn't
seem to appear if I up this timeout or bring down the
life span of the apache child processes.  Is there a
way to set a timeout on the persistent connections
on the php side?  That would enable one to match it
against the MySQL timeout and make sure it never happens."


 [2000-08-08 22:30 UTC] waldschrott@php.net
I don?t kwno any way, moving to feature request
 [2002-04-27 13:26 UTC] jimw@php.net
this isn't a feature request.
 [2002-05-26 13:40 UTC] derick@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately your version of PHP is too old -- the problem
might already be fixed. Please download a new PHP
version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC