Heim  >  Artikel  >  Backend-Entwicklung  >  php安装mysql扩展,版本不一致的解决办法

php安装mysql扩展,版本不一致的解决办法

WBOY
WBOYOriginal
2016-08-10 08:48:371314Durchsuche

php安装mysql扩展时出现如下错误:

NOTICE: PHP message: PHP Warning:  PHP Startup: mysql: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20131226
These options need to match
 in Unknown on line 0

原因是phpize和php模块的版本不一致导致的,我这里的原因是因为服务器上存在两个不同版本的phpize,先在服务器上查找下phpize,看看是否也是相同问题

locate phpsize  或者  find / -name phpize

我在/usr/local/bin目录下找到了

-rwxr-xr-x 1 root root 27264823 Sep 16  2013 php
-rwxr-xr-x 1 root root 27173725 Sep 16  2013 php-cgi
-rwxr-xr-x 1 root root     2222 Sep 16  2013 php-config
-rwxr-xr-x 1 root root     4533 Sep 16  2013 phpize

重新建立软链指向新的

lrwxrwxrwx 1 root root       22 Aug 10 08:07 php -> /usr/local/php/bin/php
lrwxrwxrwx 1 root root       26 Aug 10 08:07 php-cgi -> /usr/local/php/bin/php-cgi
lrwxrwxrwx 1 root root       29 Aug 10 08:06 php-config -> /usr/local/php/bin/php-config
lrwxrwxrwx 1 root root       25 Aug 10 08:06 phpize -> /usr/local/php/bin/phpize

然后再按照安装扩展的方法继续,问题解决

版权声明:本文为博主原创文章,未经博主允许不得转载。

以上就介绍了php安装mysql扩展,版本不一致的解决办法,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:使用 PHP 和 MySQLNächster Artikel:php AES加密兼容net