jpb83 Posted June 15, 2009 Share Posted June 15, 2009 Using MySQL 5.0.26. I believe MySQL is hanging. Note the following code: -------- echo "in connect<br>"; @ $db = mysql_pconnect( $host, $user, $password); echo "after<br>"; -------- It shows "in connect", but never gets to "after". So, I believe the problem must occur in the mysql_pconnect() call. However, I can't seem to determine from anywhere if this is a common occurence or if there are any typical causes of this behavior. Any ideas? JPB Quote Link to comment https://forums.phpfreaks.com/topic/162248-mysql-pconnect-hanging/ Share on other sites More sharing options...
jxrd Posted June 15, 2009 Share Posted June 15, 2009 Try not suppressing errors when you're trying to debug. Sounds logical? Yeah. Just found this on php.net You need to be VERY careful when using LOCK TABLES with persistent connections. If the script terminates before the UNLOCK TABLES is executed, the the table(s) will stay locked, and very likely hang future scripts. This is noted in a bug report, but is still not reflected in the documentation: http://bugs.php.net/bug.php?id=7634 Quote Link to comment https://forums.phpfreaks.com/topic/162248-mysql-pconnect-hanging/#findComment-856282 Share on other sites More sharing options...
jpb83 Posted June 15, 2009 Author Share Posted June 15, 2009 Yeah, still no luck without the error suppression. The strange thing is, the web document actually loads, just without any data from the server. Anyone else have any ideas or experienced this? JPB Quote Link to comment https://forums.phpfreaks.com/topic/162248-mysql-pconnect-hanging/#findComment-856409 Share on other sites More sharing options...
jxrd Posted June 15, 2009 Share Posted June 15, 2009 Have you tried using normal mysql_connect()? Quote Link to comment https://forums.phpfreaks.com/topic/162248-mysql-pconnect-hanging/#findComment-856410 Share on other sites More sharing options...
jpb83 Posted June 15, 2009 Author Share Posted June 15, 2009 Yessir, that was my first assumption, since persistant connections can be a bit unpredictable at times. No luck. Quote Link to comment https://forums.phpfreaks.com/topic/162248-mysql-pconnect-hanging/#findComment-856416 Share on other sites More sharing options...
jxrd Posted June 15, 2009 Share Posted June 15, 2009 I'd say it was something to do with your host then. Maybe dodgy hardware or memory leaks or something. Who knows... Quote Link to comment https://forums.phpfreaks.com/topic/162248-mysql-pconnect-hanging/#findComment-856420 Share on other sites More sharing options...
PFMaBiSmAd Posted June 15, 2009 Share Posted June 15, 2009 Remove the @ from your code (you should never use @ for any reason) and add the following two lines of code for debugging (remove them when you are done) immediately after your first opening <?php tag - ini_set("display_errors", "1"); error_reporting(E_ALL); Quote Link to comment https://forums.phpfreaks.com/topic/162248-mysql-pconnect-hanging/#findComment-856426 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.