dongzhan0624
2019-04-23 03:35
浏览 677
已采纳

ubuntu 16.04上的php 7.2上缺少请求的PHP扩展名ext-mysqli *

when I

composer create-project phpmyadmin/phpmyadmin

I got the problems:

- The requested PHP extension ext-mysqli * is missing from your system. Install or enable PHP's mysqli extension.

I had edit my php.ini and restart the php and nginx but still show the error?

sudo systemctl restart php7.2-fpm
sudo systemctl restart nginx

sudo nano /etc/php/7.2/fpm/php.ini

cgi.fix_pathinfo=0
;extension=bz2
extension=curl
;extension=fileinfo
extension=gd2
;extension=gettext
;extension=gmp
extension=intl
extension=imap
;extension=interbase
;extension=ldap
extension=mbstring
;extension=exif      ; Must be after mbstring as it depends on it
extension=mysqli
;extension=oci8_12c  ; Use with Oracle Database 12c Instant Client
;extension=odbc
extension=openssl
;extension=pdo_firebird
extension=pdo_mysql
;extension=pdo_oci
;extension=pdo_odbc
;extension=pdo_pgsql
extension=pdo_sqlite
;extension=gettext
;extension=gmp
extension=intl
extension=imap
;extension=interbase
;extension=ldap
extension=mbstring
;extension=exif      ; Must be after mbstring as it depends on it
extension=mysqli
;extension=oci8_12c  ; Use with Oracle Database 12c Instant Client
;extension=odbc
extension=openssl
;extension=pdo_firebird
extension=pdo_mysql
;extension=pdo_oci
;extension=pdo_odbc
;extension=pdo_pgsql
extension=pdo_sqlite
;extension=pgsql
;extension=shmop

; The MIBS data available in the PHP distribution must be installed.
; See http://www.php.net/manual/en/snmp.installation.php
;extension=snmp

;extension=soap
;extension=sockets
;extension=sqlite3
;extension=tidy
extension=xmlrpc
;extension=xsl

Do I need to install another mysqli? It's so strange. I had install the sudo apt-get install php7.2-fpm php7.2-mysql php7.2-cgi php7.2-common php-pear php7.2-mbstring
before and work well. But I don't know why it has the problem when I reinstall the ubuntu and mariaDB and php 7.2 and phpmyadmin.

图片转代码服务由CSDN问答提供 功能建议

当我

  composer create-project phpmyadmin / phpmyadmin \  n   
 
 

我遇到了问题:

   - 系统中缺少所请求的PHP扩展名ext-mysqli *。 安装或启用PHP的mysqli扩展。
   
 
 

我编辑了我的php.ini并重新启动了php和nginx,但仍显示错误? \ n

  sudo systemctl restart php7.2-fpm 
sudo systemctl restart nginx 
 
sudo nano /etc/php/7.2/fpm/php.ini

cgi.fix_pathinfo=0
;extension=  BZ2 
extension =卷曲\ N;延长= FileInfo的
extension = GD2 \ N;延长= gettext的\ N;延长= GMP 
extension =国际
extension = IMAP \ N;延长= IB的\ N;扩展= LDAP 
extension =  mbstring 
; extension = exif; 必须在mbstring之后,因为它取决于它
extension = mysqli 
; extension = oci8_12c; 与Oracle Database 12c一起使用Instant Client 
; extension = odbc 
extension = openssl 
; extension = pdo_firebird 
extension = pdo_mysql 
; extension = pdo_oci 
; extension = pdo_odbc 
; extension = pdo_pgsql 
extension = pdo_sqlite \  n; extension = gettext 
; extension = gmp 
extension = intl 
extension = imap 
; extension = interbase 
; extension = ldap 
extension = mbstring 
; extension = exif; 必须在mbstring之后,因为它取决于它
extension = mysqli 
; extension = oci8_12c; 与Oracle Database 12c一起使用Instant Client 
; extension = odbc 
extension = openssl 
; extension = pdo_firebird 
extension = pdo_mysql 
; extension = pdo_oci 
; extension = pdo_odbc 
; extension = pdo_pgsql 
extension = pdo_sqlite \  N;延长= pgsql的\ N;延长= shmop 
 \ N; 必须安装PHP发行版中可用的MIBS数据。
; 请参阅http://www.php.net/manual/en/snmp.installation.php
;extension=snmp

;extension=soap
;extension=sockets
;extension=sqlite3
;extension  = tidy 
extension = xmlrpc 
; extension = xsl 
   
 
 

我是否需要安装另一个mysqli? 太奇怪了。 我安装了 sudo apt-get install php7.2-fpm php7.2-mysql php7.2-cgi php7.2-common php-pear php7.2-mbstring
before并且运行良好。 但是当我重新安装ubuntu和mariaDB以及php 7.2和phpmyadmin时,我不知道为什么会出现问题。

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • dongqishun6409 2019-04-24 06:11
    已采纳

    I solve the question by installing

    $ sudo apt-get install php7.2-fpm php7.2-cli php7.2-mysql php7.2-gd php7.2-imagick php7.2-recode php7.2-tidy php7.2-xmlrpc php7.2-common php7.2-curl php7.2-mbstring php7.2-xml php7.2-bcmath php7.2-bz2 php7.2-intl php7.2-json php7.2-readline php7.2-zip
    

    But I don't know why?

    点赞 打赏 评论
  • dprc88435 2019-04-23 05:21

    This worked for me when i enabled the MySQLi extension, Enable MySQLi extension in php.ini, just uncommented this line in php.ini

    extension=php_mysqli.dll

    This is the php.ini file path

    /etc/php/7.0/apache2/php.ini

    This problem mainly occuers because by default MySQLi extension is disable in PHP 7.x

    If this doesnt work please comment below

    点赞 打赏 评论

相关推荐