MySQL/PHP Error: [2002] Only One Usage of Each Socket Address (Protocol/Network Address/Port) Is Normally Permitted
Many users have encountered the perplexing error message "[2002] Only one usage of each socket address (protocol/network address/port) is normally permitted" while attempting to connect to a MySQL database via PHP. The unique aspect of this issue is that it occurs despite Apache being fully functional.
Solution:
To resolve this error, you can modify the Windows registry settings:
TcpTimedWaitDelay REG_DWORD: 0000001e (hex) MaxUserPort REG_DWORD: 0000fffe (hex) TcpNumConnections REG_DWORD: 00fffffe (hex) TcpMaxDataRetransmissions REG_DWORD: 00000005 (hex)
Reference:
[Reference Link](https://i.sstatic.net/diJfQ.png)
By implementing these registry modifications, you can effectively eliminate the error message and restore seamless connectivity between PHP and MySQL databases.
The above is the detailed content of Why am I getting the "Only One Usage of Each Socket Address" Error When Connecting to MySQL with PHP?. For more information, please follow other related articles on the PHP Chinese website!