another mysql_pconnect error

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
numer9

another mysql_pconnect error

Post by numer9 »

Hey, i've seen couple of topics with similar problems, but none exactly about mine...

after installing, configuring and using for couple of days, suddenly i'm getting:

Warning: mysql_pconnect(): Lost connection to MySQL server during query in /home/numer9/ftp/amtel/beta/lib/adodb/drivers/adodb-mysql.inc.php on line 356

Warning: Smarty error: unable to read resource: "db:-1" in /home/numer9/ftp/amtel/beta/lib/smarty/Smarty.class.php on line 1088

(if u want to check it out, http://www.numer9.pl/amtel/beta/)

Mysql on my server is up and running. I'm having another CMS installed, also based on Mysql+php (mambo to be exact), so I got constant check-out.

The strangest thing is that it happend just after another refresh of the page. I was altering css (of a plugin), so I couldn't mess up with the code...

To give full problem description - I was having 500 [Internal server problem] from time-to-time (about once every 40 refresh of the page). My admin says it could be because of many mysql open connections, not closed properly. I doubt it, saying that it's a 0.10 version and it's not buggy software.

Can anyone help me? Cause I really don't know what to do, what to debug or anything. It's the usual mysql_pconnect line the error's reffering... log file of apache isn't saying anything... And i'm supposed to be done with that webpage about week ago :(

numer9
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: another mysql_pconnect error

Post by Ted »

Try setting persistent_db_conn to false in config.php.  The persistent connections could be conflicting with the mysql config for some reason or another.
numer9

Re: another mysql_pconnect error

Post by numer9 »

ok, thanks. I set it up and now I'm testing... yesterday's night fault (with everything just hanging for no reason) is gone - don't know what happend... maybe my admin was upgrading something or i-don't-know.

Do u have any experience in persistant-connection hanging? Any system / enviroment dependencies..?

numer9
earlten

Re: another mysql_pconnect error

Post by earlten »

Yo.  I'm getting this also.  the pconnect change has NO effect.  It's your latest version of cmsms with a new install of CentOS.  It worked for over a week and we lost power last night.  Rebooted this morning and cmsms is fubar.  I can connect to mysql using mysql -u user(cmsmsuser that is) and my password.  The error prior to pconnect was:

PHP Warning:  mysql_pconnect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /var/www/html/lib/adodb/drivers/adodb-mysql.inc.php on line 356
PHP Warning:  Smarty error: unable to read resource: "db:-1" in /var/www/html/lib/smarty/Smarty.class.php on line 1088

Now I just get the same error line 340.

We are scheduled for site roll-out and now my organization, as well as myself are wondering if we made the right choice.  I see the same suggestions over & over on how to resolve this, but no real resolutions.  How do I fix this?

- Bill
earlten

Re: another mysql_pconnect error

Post by earlten »

Okay you mongoloids.  If you do a dmesg, you get some insight into this.  I had checked everything but dmesg, and to my amusement, someone suggested this and I figured, why the heck not.  In my case, as is, I'm guessing with others here, SELinux was preventing access to the sql socket.  The dmesg notice was this:

avc:  denied  { connectto } for  pid=2963 comm=httpd path=/var/lib/mysql/mysql.sock scontext=root:system_r:httpd_t tcontext=root:system_r:unconfined_t tclass=unix_stream_socket

So far, I have completely DISABLED SELinux, and everything started working again.  I switched back to SELINUX=enforcing (in /etc/selinux/config, this re-enables SELinux) and I get the same problems.  I will be working on a solution for this, when I have one , I will try to remember to post!  In the meantime, do not DISABLE SELinux, just set it to permissive.  You will need the security reports it is generating!

Cheers!  -Bill
Locked

Return to “[locked] Installation, Setup and Upgrade”