Jump to content

Recommended Posts

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

 

Link to comment
https://forums.phpfreaks.com/topic/162248-mysql-pconnect-hanging/
Share on other sites

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

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);

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.