php mysqli::close()
生活随笔
收集整理的這篇文章主要介紹了
php mysqli::close()
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Anonymous (24-Apr-2010 05:43)
?
The mysqli_close() function and object method only remove the ability to use the mysql object again in the script, essentially on the surface only nulling out all object parameters.過程化的mysqli_close()函數和面向對象的方法調用只是不讓用戶在此后的腳本中再使用mysql對象,基本上只在表面上歸零所有對象參數
At least with PHP5.3.2 and Windows connecting by tcp, this differs by the old mysql_close() function in that it does not actually close out the tcp socket being used.? You should always use mysqli_kill() function before mysqli_close() to actually close and free up the tcp socket being used by PHP.? Garbage collection after script execution nor mysqli_close() do not kill the tcp socket on their own.? The socket would otherwise remain in 'wait' state for approximately 30 seconds, and any additional page loads/connection attempts would only add to the total number of open tcp connections.? This wait time does not appear to be configurable via PHP settings.
至少在利用windows的tcp連接的這個版本的php中,舊的函數并沒有真正的關閉正在被使用的tcp連接,你應該總是在調用mysqli_close()前使用mysqli_kill()函數,確保釋放php正在使用的tcp套接字連接。腳本結束后執行gc要么mysqli_close()是不會自己殺掉這個tcp連接的。這個tcp連接會保持大約30秒的等待狀態,期間任何頁面的加載或連接的嘗試都會增加連接的總數,而這個等待時間似乎在php的配置文件中是不能設置的
Also as of this version, mysqli created links cannot be "deactivated", and will continue to accumulate in process memory until the PHP server or process is restarted, essentially making mysqli.max_links = -1 required. 另外在這個版本中,mysqli創建的連接是不能被設置為無效的,而且連接會在這個進程中積累,知道php服務器或者進程重啟,所以可以設置mysqli.max_links = -1
轉載于:https://www.cnblogs.com/iLoveMyD/archive/2012/02/28/2370715.html
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的php mysqli::close()的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【转】Asp.NET大文件上传开发总结(
- 下一篇: 那些年,我还在学习actionscrip