php最新版本配置mysqli

來源:互聯網
上載者:User

標籤:技術分享   client   串連   直接   div   must   src   一段   new   

從官網上下載php後(我下的是php7.2.3版本),本想做個mysql的串連,但是無論怎麼配置mysqli擴充,發現mysqli都沒法用。

從百度上搜的那些方法都沒法用,發現都是一些在php.ini中配置extension=php_mysqli.dll,事實上這句話沒用了。

於是我仔細看了一下php.ini的設定檔,發現了一段話

; Note : The syntax used in previous PHP versions (‘extension=<ext>.so‘ and; ‘extension=‘php_<ext>.dll‘) is supported for legacy reasons and may be; deprecated in a future PHP major version. So, when it is possible, please; move to the new (‘extension=<ext>) syntax.

大意就是以前版本的用extension=<ext>.so或者extension=<ext>.dll,現在的php版本建議直接使用extension=<ext>

不需要加勞什子extension=php_mysqli.dll這句話,而且php.ini設定檔中本來就沒有extension=php_mysqli.dll,

;extension=ldap;extension=mbstring;extension=exif      ; Must be after mbstring as it depends on itextension=mysqli;extension=oci8_12c  ; Use with Oracle Database 12c Instant Client;extension=openssl;extension=pdo_firebird;extension=pdo_mysql;extension=pdo_oci;extension=pdo_odbc

這些都沒有dii尾碼,直接將;extension=mysqli前面的分號去掉就是。

配置完之後我發現還是不能用,後來發現,extension_dir=“ext”這句話必須改為絕對路徑:

; Directory in which the loadable extensions (modules) reside.; http://php.net/extension-dir;extension_dir = "./";On windows:extension_dir = "E:\PHP\php7.2\ext"

相對路徑似乎不能使用。

然後再對Apache設定檔修改一下,就能夠使用了,這一方面的倒是沒什麼變化,網上一搜一大堆,

 

最後總結來說,和以前相比需要改動的就兩點:

1、直接去掉;extension=mysqli的注釋;

2、extension_dir的路徑應為絕對路徑,如extension_dir = "E:\PHP\php7.2\ext"

 

最終用phpinfo()查看的結果為:

就表示配置成功!

 

php最新版本配置mysqli

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.