Home >Database >Mysql Tutorial >How to Fix the 'Only One Usage of Each Socket Address' Error in MySQL/PHP Connections?

How to Fix the 'Only One Usage of Each Socket Address' Error in MySQL/PHP Connections?

Barbara Streisand
Barbara StreisandOriginal
2024-11-10 13:51:02332browse

How to Fix the

Troubleshooting "Only One Usage of Each Socket Address" Error in MySQL/PHP Connections

Users of PHP/MySQL websites may occasionally encounter the following error message:

PHP Warning: mysql_connect() [function.mysql-connect]:
[2002] Only one usage of each socket address (protocol/network address/port)
is normally permitted.

While this issue is often associated with Apache not starting first, it can arise even after Apache is running. To resolve this problem, consider the following:

Modifying Windows Registry:

Adjusting the Windows Registry can help fix this error. Navigate to the following registry path:

HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

Create four new DWORD keys with the following values:

TcpTimedWaitDelay: 0x0000001e
MaxUserPort: 0x0000fffe
TcpNumConnections: 0x00fffffe
TcpMaxDataRetransmissions: 0x00000005

After making these changes, restart your system for the changes to take effect.

References:

  • Stack Overflow: https://i.sstatic.net/diJfQ.png

The above is the detailed content of How to Fix the 'Only One Usage of Each Socket Address' Error in MySQL/PHP Connections?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn