如何在php 7中启用sqmyli扩展?

时间:2022-06-18 23:27:15

I have installed PHP 7, MySQL 5.5.47 on Ubuntu 14.04. I have checked installed extension using :

我在Ubuntu 14.04上安装了PHP 7, MySQL 5.5.47。我检查了安装扩展使用:

sudo apt-cache search php7-*

Its output me:

其输出我:

php7.0-common - Common files for packages built from the PHP source
libapache2-mod-php7.0 - server-side, HTML-embedded scripting language (Apache 2 module)
php7.0-cgi - server-side, HTML-embedded scripting language (CGI binary)
php7.0-cli - command-line interpreter for the PHP scripting language
php7.0-phpdbg - server-side, HTML-embedded scripting language (PHPDBG binary)
php7.0-fpm - server-side, HTML-embedded scripting language (FPM-CGI binary)
libphp7.0-embed - HTML-embedded scripting language (Embedded SAPI library)
php7.0-dev - Files for PHP7.0 module development
php7.0-dbg - Debug symbols for PHP7.0
php7.0-curl - CURL module for PHP
php7.0-enchant - Enchant module for PHP
php7.0-gd - GD module for PHP
php7.0-gmp - GMP module for PHP
php7.0-imap - IMAP module for PHP
php7.0-interbase - Interbase module for PHP
php7.0-intl - Internationalisation module for PHP
php7.0-ldap - LDAP module for PHP
php7.0-mcrypt - libmcrypt module for PHP
php7.0-readline - readline module for PHP
php7.0-odbc - ODBC module for PHP
php7.0-pgsql - PostgreSQL module for PHP
php7.0-pspell - pspell module for PHP
php7.0-recode - recode module for PHP
php7.0-snmp - SNMP module for PHP
php7.0-tidy - tidy module for PHP
php7.0-xmlrpc - XMLRPC-EPI module for PHP
php7.0-xsl - XSL module for PHP
php7.0 - server-side, HTML-embedded scripting language (metapackage)
php7.0-json - JSON module for PHP
php-all-dev - package depending on all supported PHP development packages
php7.0-sybase - Sybase module for PHP
php7.0-sqlite3 - SQLite3 module for PHP
php7.0-mysql - MySQL module for PHP
php7.0-opcache - Zend OpCache module for PHP
php7.0-bz2 - bzip2 module for PHP

I am not able to see MySQLi extension using phpinfo() as well,please let me know,how can I enable/install MySQLi extension in PHP 7. That's why I cannot use phpmyadmin, its says "The mysqli extension is missing."

我也无法看到使用phpinfo()的MySQLi扩展,请让我知道如何在PHP 7中启用/安装MySQLi扩展。这就是为什么我不能使用phmypadmin,它说“mysqli扩展被丢失了”。

Note: I am new in php7.

注:我是php7的新成员。

4 个解决方案

#1


63  

The problem is that the package that used to connect PHP to MYSQL is depricated (php5-mysql). If you install the new package:

问题是用来连接PHP到MYSQL的包被取消了(php5-mysql)。如果你安装新包装:

sudo apt-get install php-mysql

This will automatically update apache and php7.

这将自动更新apache和php7。

Cheers!

干杯!

#2


24  

I got the solution,I am able to enable MySQLi extension in php.ini, just uncommented this line in php.ini

我得到了解决方案,我能够在php中启用sqmyli扩展。ini,在php。ini中没有评论这句话

extension=php_mysqli.dll

Now MySQLi working well.Here is php.ini file path in apache2,PHP 7, Ubuntu 14.04 environment:

现在MySQLi工作正常。这是php。在apache2、PHP 7、Ubuntu 14.04环境中的ini文件路径:

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

By Default MySQLi extension is disable in PHP 7.

默认情况下,MySQLi扩展在PHP 7中禁用。

#3


9  

In ubuntu need to uncommented this line in php.ini which is located at /etc/php/7.0/apache2/php.ini

在ubuntu中,需要在php中取消注释。ini位于/etc/php/7.0/apache2/php.ini

extension=php_mysqli.so

扩展= php_mysqli.so

#4


5  

sudo phpenmod mysqli
sudo service apache2 restart

  • phpenmod moduleName enables a module to php7 (restart apache after that sudo service apache2 restart)
  • phpenmod moduleName支持php7的模块(在sudo服务apache2重新启动后重新启动apache)
  • phpdismod moduleName disables a module to php7 (restart apache after that sudo service apache2 restart)
  • phpdismod moduleName将模块禁用到php7(在sudo服务apache2重新启动之后重新启动apache)
  • php -m lists the loaded modules
  • php -m列出已加载的模块

#1


63  

The problem is that the package that used to connect PHP to MYSQL is depricated (php5-mysql). If you install the new package:

问题是用来连接PHP到MYSQL的包被取消了(php5-mysql)。如果你安装新包装:

sudo apt-get install php-mysql

This will automatically update apache and php7.

这将自动更新apache和php7。

Cheers!

干杯!

#2


24  

I got the solution,I am able to enable MySQLi extension in php.ini, just uncommented this line in php.ini

我得到了解决方案,我能够在php中启用sqmyli扩展。ini,在php。ini中没有评论这句话

extension=php_mysqli.dll

Now MySQLi working well.Here is php.ini file path in apache2,PHP 7, Ubuntu 14.04 environment:

现在MySQLi工作正常。这是php。在apache2、PHP 7、Ubuntu 14.04环境中的ini文件路径:

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

By Default MySQLi extension is disable in PHP 7.

默认情况下,MySQLi扩展在PHP 7中禁用。

#3


9  

In ubuntu need to uncommented this line in php.ini which is located at /etc/php/7.0/apache2/php.ini

在ubuntu中,需要在php中取消注释。ini位于/etc/php/7.0/apache2/php.ini

extension=php_mysqli.so

扩展= php_mysqli.so

#4


5  

sudo phpenmod mysqli
sudo service apache2 restart

  • phpenmod moduleName enables a module to php7 (restart apache after that sudo service apache2 restart)
  • phpenmod moduleName支持php7的模块(在sudo服务apache2重新启动后重新启动apache)
  • phpdismod moduleName disables a module to php7 (restart apache after that sudo service apache2 restart)
  • phpdismod moduleName将模块禁用到php7(在sudo服务apache2重新启动之后重新启动apache)
  • php -m lists the loaded modules
  • php -m列出已加载的模块