首頁 >後端開發 >php教程 >PHP 動態編譯安裝 mysqli mysql mysqlnd

PHP 動態編譯安裝 mysqli mysql mysqlnd

WBOY
WBOY原創
2016-07-29 08:58:532053瀏覽

下載對應版本的PHP源碼並解壓縮,我的版本是php-5.4.16

進入源碼目錄下的ext/mysqlnd,並編譯出mysqlnd.so

<code><span>cp</span> config9<span>.m</span>4 config<span>.m</span>4
sed -ie <span>"s{ext/mysqlnd/php_mysqlnd_config.h{config.h{"</span> mysqlnd_portability<span>.h</span><span>#修改源文件</span>
phpize  <span>#执行phpize,增加./configure 配置</span>
./configure --with-php-c/to/php-config  <span>#配置文件为原php的bin下的php-config</span>
sudo make &&sudo make install  <span>#编译安装</span></code>

如果不曉得php-config在哪裡,可以用這個指令找出

<code>sudo find <span>/</span><span>-name</span> php<span>-config</span></code>

進入ext/mysql,編譯出mysql.so

<code>phpize
<span>.</span>/configure <span>--</span><span>with</span><span>-php</span><span>-config</span><span>=</span>/path/<span>to</span>/php<span>-config</span><span>--</span><span>with</span><span>-mysql</span><span>=</span>mysqlnd
make <span>&&</span> make install</code>

進入ext/mysqli,編譯出mysqli.so

<code>phpize
<span>.</span>/configure <span>--</span><span>with</span><span>-php</span><span>-config</span><span>=</span>/path/<span>to</span>/php<span>-config</span><span>--</span><span>with</span><span>-mysqli</span><span>=</span>mysqlnd
make <span>&&</span> make install</code>

在php.ini中加入

<code><span>extension=<span>mysqlnd</span></span><span>extension=<span>mysql</span></span><span>extension=<span>mysqli</span></span></code>
').addClass(pre-rrreee').addClass(pre-rrreee').addClass(pre-rrreee

').addClass(pre- numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i

').text(i)); }; $numbering.fadeIn(1700); }); });

以上就介紹了PHP 動態編譯安裝 mysqli mysql mysqlnd,包含了方面的內容,希望對PHP教學有興趣的朋友有幫助。 🎜 🎜 🎜
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn