国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

php無(wú)法連接mysqli怎么辦

藏色散人
發(fā)布: 2022-11-09 10:07:08
原創(chuàng)
3848人瀏覽過(guò)
php無(wú)法連接mysqli的解決辦法:1、打開“php.ini”文件;2、找到“mysqli.reconnect”;3、將“mysqli.reconnect = OFF”改成“mysqli.reconnect = on”即可。

php無(wú)法連接mysqli怎么辦

本教程操作環(huán)境:windows7系統(tǒng)、PHP8.1版、Dell G3電腦。

php無(wú)法連接mysqli怎么辦?

PHP連接MySql,解決 ”Uncaught Error: Class ‘mysqli‘ not found“問題

我的PHP是7.4的,但是mysql擴(kuò)展好像是5以前的,我就只能用mysqli擴(kuò)展來(lái)操作數(shù)據(jù)庫(kù)

立即學(xué)習(xí)PHP免費(fèi)學(xué)習(xí)筆記(深入)”;

我看了幾十篇回答,我的錯(cuò)誤是phpinfo()頁(yè)面只有一個(gè)mysqlnd,沒有mysqli,所以網(wǎng)頁(yè)會(huì)報(bào)錯(cuò) ”Uncaught Error: Class ‘mysqli’ not found“

在php.ini里

extension_dir = “ext” 也改成絕對(duì)路徑了,;extension=php_mysqli.dll前面的 ; 也去掉了,還是不行

最后發(fā)現(xiàn)下面這段

[MySQLi]

; Maximum number of persistent links. -1 means no limit.
; http://php.net/mysqli.max-persistent
mysqli.max_persistent = -1

; Allow accessing, from PHP’s perspective, local files with LOAD DATA statements
; http://php.net/mysqli.allow_local_infile
;mysqli.allow_local_infile = On

; Allow or prevent persistent links.
; http://php.net/mysqli.allow-persistent
mysqli.allow_persistent = On

; Maximum number of links. -1 means no limit.
; http://php.net/mysqli.max-links
mysqli.max_links = -1

; Default port number for mysqli_connect(). If unset, mysqli_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
; at MYSQL_PORT.
; http://php.net/mysqli.default-port
mysqli.default_port = 3306

; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
; http://php.net/mysqli.default-socket
mysqli.default_socket =

; Default host for mysqli_connect() (doesn’t apply in safe mode).
; http://php.net/mysqli.default-host
mysqli.default_host =

; Default user for mysqli_connect() (doesn’t apply in safe mode).
; http://php.net/mysqli.default-user
mysqli.default_user =

; Default password for mysqli_connect() (doesn’t apply in safe mode).
; Note that this is generally a bad idea to store passwords in this file.
; Any user with PHP access can run 'echo get_cfg_var(“mysqli.default_pw”)
; and reveal this password! And of course, any users with read access to this
; file will be able to reveal the password as well.
; http://php.net/mysqli.default-pw
mysqli.default_pw =

; Allow or prevent reconnect
mysqli.reconnect = OFF
登錄后復(fù)制

將mysqli.reconnect = OFF改成mysqli.reconnect = on就行了,就很無(wú)語(yǔ),有跟我情況一樣的可以改改這個(gè)

推薦學(xué)習(xí):《PHP視頻教程

以上就是php無(wú)法連接mysqli怎么辦的詳細(xì)內(nèi)容,更多請(qǐng)關(guān)注php中文網(wǎng)其它相關(guān)文章!

PHP速學(xué)教程(入門到精通)
PHP速學(xué)教程(入門到精通)

PHP怎么學(xué)習(xí)?PHP怎么入門?PHP在哪學(xué)?PHP怎么學(xué)才快?不用擔(dān)心,這里為大家提供了PHP速學(xué)教程(入門到精通),有需要的小伙伴保存下載就能學(xué)習(xí)啦!

下載
相關(guān)標(biāo)簽:
來(lái)源:php中文網(wǎng)
本文內(nèi)容由網(wǎng)友自發(fā)貢獻(xiàn),版權(quán)歸原作者所有,本站不承擔(dān)相應(yīng)法律責(zé)任。如您發(fā)現(xiàn)有涉嫌抄襲侵權(quán)的內(nèi)容,請(qǐng)聯(lián)系admin@php.cn
最新問題
開源免費(fèi)商場(chǎng)系統(tǒng)廣告
最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板
關(guān)于我們 免責(zé)申明 意見反饋 講師合作 廣告合作 最新更新
php中文網(wǎng):公益在線php培訓(xùn),幫助PHP學(xué)習(xí)者快速成長(zhǎng)!
關(guān)注服務(wù)號(hào) 技術(shù)交流群
PHP中文網(wǎng)訂閱號(hào)
每天精選資源文章推送
PHP中文網(wǎng)APP
隨時(shí)隨地碎片化學(xué)習(xí)
PHP中文網(wǎng)抖音號(hào)
發(fā)現(xiàn)有趣的

Copyright 2014-2025 http://www.miracleart.cn/ All Rights Reserved | php.cn | 湘ICP備2023035733號(hào)