當前位置:生活全書館 >

學習教育

> php7安裝mysqli例項講解

php7安裝mysqli例項講解

本文操作環境:Windows7系統、php-7.1.5、Dell G3。

php7安裝mysqli例項講解

php7 怎麼安裝mysqli?

centos php7 安裝mysqli擴充套件心得

在新配伺服器時發現,php無法連線到mysql。通過phpinfo發現。根本沒有顯示mysqli的相關配置。經過一系列研究。總結了下。:

第一步:

在phpinfo裡沒有mysqli配置,原因是安裝php7時沒有configure mysqli

安裝php方法:wget http://cn2.php.net/distributions/php-7.1.5.tar.gz

tar zxvf php-7.1.5.tar.gzcd php-7.1.5./configure --with-php-config=/usr/local/php/bin/php-config --with-mysqli=/usr/bin/mysql_config             注:/usr/bin/mysql_config   這個路徑為自己的mysql_config路徑   可通過 find -name mysql_config查詢make && make install        cp  php.ini-development /usr/local/lib/php.inicp sapi/fpm/init.d.php-fpm /etc/init.d/php7-fpmchmod +x /etc/init.d/php7-fpmcd /usr/local/php/etccp php-fpm.conf.default php-fpm.confcp php-fpm.d/www.conf.default php-fpm.d/www.conf/etc/init.d/php7-fpm  start 啟動php

安裝完之後會發現phpinfo有mysqli了

第二步:安裝mysqli擴充套件

方法:

cd /usr/local/php-7.1.5/ext/mysqli   //到php檔案ext下的mysqli/usr/local/php/bin/phpize./configure --with-php-config=/usr/local/php/bin/php-config --with-mysqli=/usr/bin/mysql_config

注:usr/bin/mysql_config 路徑同第一步方法

現在應該已經有mysqli擴充套件了

第三步:

修改php.ini

通過phpinfo 查詢到php.ini的路徑。修改php.ini。取消註釋php_mysqi.dll

到此這篇關於php7 安裝mysqli例項講解的文章就介紹到這了,更多相關php內容請搜尋好二三四以前的文章,希望大家以後多多支援好二三四!

<link rel="stylesheet" href="https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4f61d3594de/a4ea273683c8.css" type="text/css" /><link rel="stylesheet" href="https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4f61d3594de/a4ea303194c0eaf695827b59325e.css" type="text/css" /><script type="text/javascript" src="https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea2c3096c5e3db978c6e492c.js"></script> <script>SyntaxHighlighter.autoloader( 'applescript https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7f3809476490d49a2a6da28.js', 'actionscript3 as3 https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7f3a3d7.js', 'bash shell https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7f0919772.js', 'coldfusion cf https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7f19f887e6a2b59b9a0c4.js', 'cpp c https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7f18094.js', 'obj-c objc https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7fd928e59.js', 'c# c-sharp csharp https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7f1a38c7b5e2e.js', 'css https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7f18397.js', 'delphi pascal https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7f695886a4437.js', 'diff patch pas https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7f699827c.js', 'erl erlang https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7f782887b4239.js', 'groovy https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7f5828b755a27.js', 'haxe hx https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7fa919c7f.js', 'java https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7f891927b.js', 'jfx javafx https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7f891927b6a06.js', 'js jscript javascript https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7f8a38768452e5e.js', 'perl pl https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7e2959676.js', 'php https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7e29894.js', 'text plain https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7e29c857342.js', 'py python https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7e28990724330.js', 'ruby rails ror rb https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7e0858663.js', 'scala https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7e19385764d.js', 'sql https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7e18188.js', 'vb vbnet https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7e492.js', 'ps powershell https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7e29f937f5e0d42b5a3c6.js', 'xml xhtml xslt html https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7ea9d88.js', 'go golang https://js.how234.com/bdf1083093/a4fb0a2d90d5e7db978c76453942a4aad8/a4e1163081d9fc80c0d628/a4ea262b84dee7f59f.js' );</script> <script type="text/javascript"> SyntaxHighlighter.all(); </script>

  • 文章版權屬於文章作者所有,轉載請註明 https://shqsg.com/xuexijiaoyu/v8yn5y.html