首页 >后端开发 >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-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