phpScheduleIt
May 21, 2013, 07:47:31 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: phpScheduleIt 2.4.2 has been released!
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: "Error connecting to database: DB Error: connect failed" with multiple users  (Read 7012 times)
apallares
Newbie
*

Karma: 0
Posts: 13


« on: September 01, 2011, 01:52:21 PM »

Recently i moved my setup to a hosting service, and works normally, but when multiple users log or try to log at the same time show this error randomly:

"Error connecting to database: DB Error: connect failed"

 and you have to reload the page several times.

In my home installation I have not detected the fault and apparently the two setups are similar.

which could be the problem?

Thanks
Logged
apallares
Newbie
*

Karma: 0
Posts: 13


« Reply #1 on: September 05, 2011, 07:06:40 AM »


Submit this information if is helpful:

This is the configuration of hosting server:

PHP Version: 5.2.14
MySQL Version: 5.0.87

System: Linux 2.6.18-238.19.1.el5 #1 SMP x86_64

Configure command: './configure' '--enable-bcmath' '--enable-calendar' '--enable-discard-path' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' '--enable-pdo=shared' '--enable-soap' '--enable-sockets' '--enable-wddx' '--enable-zend-multibyte' '--enable-zip' '--prefix=/usr/local' '--with-apxs2=/usr/local/apache/bin/apxs' '--with-bz2' '--with-config-file-path=/usr/local/lib' '--with-config-file-scan-dir=/usr/local/lib/php.ini.d' '--with-curl=/opt/curlssl/' '--with-curlwrappers' '--with-freetype-dir=/usr' '--with-gd' '--with-gettext' '--with-imap=/opt/php_with_imap_client/' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-ldap=/usr/local/openldap' '--with-libdir=lib64' '--with-libexpat-dir=/usr' '--with-libxml-dir=/opt/xml2' '--with-libxml-dir=/opt/xml2/' '--with-mcrypt=/opt/libmcrypt/' '--with-mhash=/opt/mhash/' '--with-mime-magic' '--with-ming=/opt/ming/' '--with-mm=/opt/mm/' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-mysqli=/usr/bin/mysql_config' '--with-openssl=/usr' '--with-openssl-dir=/usr' '--with-pcre-regex=/opt/pcre' '--with-pdo-mysql=shared' '--with-pdo-sqlite=shared' '--with-pic' '--with-png-dir=/usr' '--with-sqlite=shared' '--with-tidy=/opt/tidy/' '--with-ttf' '--with-xmlrpc' '--with-xpm-dir=/usr' '--with-xsl=/opt/xslt/' '--with-zlib' '--with-zlib-dir=/usr'

Virtual Directory Support:  disabled 
PHP API:  20041225 
PHP Extension:  20060613 
Zend Extension:  220060519 
Thread Safety:  disabled 
Zend Memory Manager:  enabled 
IPv6 Support:  enabled 
Registered PHP Streams:  compress.zlib, compress.bzip2, dict, ftp, ftps, http, https, imap, imaps, pop3, pop3s, rtsp, smtp, smtps, telnet, tftp, php, file, data, zip 
Registered Stream Socket Transports:  tcp, udp, unix, udg, ssl, sslv3, sslv2, tls 
Registered Stream Filters:  zlib.*, bzip2.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed 

Thanks
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #2 on: September 06, 2011, 01:35:14 PM »

You're saying that it works sometimes but not others?  That sounds very strange.  Are you sure that they're all going to the new host?

My guess is that nothing is working on the new host, and it's probably a simple config change for the database settings.
Logged
apallares
Newbie
*

Karma: 0
Posts: 13


« Reply #3 on: September 08, 2011, 03:10:58 AM »

If the application is used only by one or two users no problem, but when enter several (4 or more at once) to make a reservation or simply try to log shows the error.

It seems an error to access the database when there are more connections open.
« Last Edit: September 08, 2011, 11:26:04 AM by apallares » Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #4 on: September 12, 2011, 01:39:47 PM »

Is the new installation of MySQL configured to limit the number of concurrent connections?
Logged
apallares
Newbie
*

Karma: 0
Posts: 13


« Reply #5 on: September 15, 2011, 12:33:46 PM »

No, mysql connections are unlimited.

« Last Edit: September 16, 2011, 05:58:53 AM by apallares » Logged
apallares
Newbie
*

Karma: 0
Posts: 13


« Reply #6 on: September 16, 2011, 11:35:07 AM »


I have set  $conf['app']['safeMode'] to 1 because if I put it to 0 will produce this error:

Warning: include_once(DB.php) [function.include-once]: failed to open stream: No such file or directory in /home/phpscheduleit/lib/DBEngine.class.php on line 26

Warning: include_once() [function.include]: Failed opening 'DB.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/phpscheduleit/lib/DBEngine.class.php on line 26

Fatal error: Class 'DB' not found in /home/phpscheduleit/lib/DBEngine.class.php on line 75

Thanks.
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #7 on: September 19, 2011, 01:35:12 PM »

When safeMode is set to 1 you are seeing this error?  That doesn't seem right.  Within the /lib directory do you have a /pear/DB directory?
Logged
apallares
Newbie
*

Karma: 0
Posts: 13


« Reply #8 on: September 19, 2011, 02:34:09 PM »

I'm seeing this error when SafeMode is set to 0  (default) at hosting installation.

What is the difference between default and safe mode?

Can I use default mode with a hosting service?

I use default mode in my test linuxbox and not seeing database connection errors.

Thanks
« Last Edit: September 20, 2011, 11:34:49 AM by apallares » Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #9 on: September 26, 2011, 01:31:27 PM »

I'd suggest putting safeMode to 1.  This simply uses some local files instead of shared ones.
Logged
apallares
Newbie
*

Karma: 0
Posts: 13


« Reply #10 on: September 28, 2011, 02:13:07 AM »

I'll try to change hosting service.

Thanks
Logged
kevinleo24
Newbie
*

Karma: 0
Posts: 2


WWW
« Reply #11 on: November 08, 2011, 02:39:08 PM »

No, mysql connections are unlimited.
Kaktus Kostüm
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!