Home >Database >Mysql Tutorial >How to Fix the 'Only One Usage of Each Socket Address' Error in MySQL/PHP Connections?
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:
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!