MySQL/PHP Error:[2002] Only one usage of each socket address (protocol/network address/port) is normally permitted

前端 未结 6 1967
陌清茗
陌清茗 2020-11-27 08:11

I couldn\'t find a solution to this already on stackoverflow, most other related topics had to do with Apache not starting first and getting this error. My issue is that aft

6条回答
  •  攒了一身酷
    2020-11-27 08:20

    FWIW, I had the same issue on a similar setup (Windows XP). The same code worked without this issue on Mac (OS X).

    I resolved the issue by using a persistent connection within the MySQLi class.

    See here for more information: http://php.net/mysqli.persistconns

    Make sure you are aware of all the gotchas / caveats associated to using a persistent connection.

提交回复
热议问题