우분투16 php-mysql 설치

(우분투 php-mysql 설치에서 넘어옴)

1 개요[편집]

우분투 php-mysql 설치
우분투16 php-mysql 설치
PHP Fatal error: Uncaught Error: Class 'mysqli' not found

2 확인[편집]

root@zetawiki:~# php -m | grep mysql
root@zetawiki:~# php -r "new mysqli();"
PHP Fatal error:  Uncaught Error: Class 'mysqli' not found in Command line code:1
Stack trace:
#0 {main}
  thrown in Command line code on line 1
root@zetawiki:~# apt list php*mysql
Listing... Done
php-mdb2-driver-mysql/xenial 1.5.0b4-1ubuntu1 all
php-mysql/xenial 1:7.1+53~ubuntu16.04.1+deb.sury.org+1 all
php5.6-mysql/xenial 5.6.31-1~ubuntu16.04.1+deb.sury.org+1 amd64
php7.0-mysql/xenial 7.0.21-1~ubuntu16.04.1+deb.sury.org+1 amd64
php7.1-mysql/xenial 7.1.7.retag-1+ubuntu16.04.1+deb.sury.org+1 amd64
php7.2-mysql/xenial 7.2.0~alpha3-1~ubuntu16.04.1+deb.sury.org+1 amd64

3 설치[편집]

root@zetawiki:~# apt install php-mysql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  php7.1-mysql
The following NEW packages will be installed:
  php-mysql php7.1-mysql
0 upgraded, 2 newly installed, 0 to remove and 93 not upgraded.
Need to get 126 kB of archives.
After this operation, 477 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 php7.1-mysql amd64 7.1.7.retag-1+ubuntu16.04.1+deb.sury.org+1 [121 kB]
Get:2 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 php-mysql all 1:7.1+53~ubuntu16.04.1+deb.sury.org+1 [5,322 B]
Fetched 126 kB in 3s (39.9 kB/s)
Selecting previously unselected package php7.1-mysql.
(Reading database ... 86413 files and directories currently installed.)
Preparing to unpack .../php7.1-mysql_7.1.7.retag-1+ubuntu16.04.1+deb.sury.org+1_amd64.deb ...
Unpacking php7.1-mysql (7.1.7.retag-1+ubuntu16.04.1+deb.sury.org+1) ....................] 
Selecting previously unselected package php-mysql.......................................] 
Preparing to unpack .../php-mysql_1%3a7.1+53~ubuntu16.04.1+deb.sury.org+1_all.deb ...
Unpacking php-mysql (1:7.1+53~ubuntu16.04.1+deb.sury.org+1) ............................] 
Processing triggers for libapache2-mod-php7.1 (7.1.7.retag-1+ubuntu16.04.1+deb.sury.org+1) ...
Setting up php7.1-mysql (7.1.7.retag-1+ubuntu16.04.1+deb.sury.org+1) ...
Progress: [ 63%] [#############################################.........................] 
Creating config file /etc/php/7.1/mods-available/mysqlnd.ini with new version

Creating config file /etc/php/7.1/mods-available/mysqli.ini with new version

Creating config file /etc/php/7.1/mods-available/pdo_mysql.ini with new version
Setting up php-mysql (1:7.1+53~ubuntu16.04.1+deb.sury.org+1) ...#####...................] 
Processing triggers for libapache2-mod-php7.1 (7.1.7.retag-1+ubuntu16.04.1+deb.sury.org+1) ...

4 확인 2[편집]

root@zetawiki:~# apt list php*mysql
Listing... Done
php-mdb2-driver-mysql/xenial 1.5.0b4-1ubuntu1 all
php-mysql/xenial,now 1:7.1+53~ubuntu16.04.1+deb.sury.org+1 all [installed]
php5.6-mysql/xenial 5.6.31-1~ubuntu16.04.1+deb.sury.org+1 amd64
php7.0-mysql/xenial 7.0.21-1~ubuntu16.04.1+deb.sury.org+1 amd64
php7.1-mysql/xenial,now 7.1.7.retag-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installed,automatic]
php7.2-mysql/xenial 7.2.0~alpha3-1~ubuntu16.04.1+deb.sury.org+1 amd64
root@zetawiki:~# php -r "new mysqli();"
root@zetawiki:~# php -m | grep mysql
mysqli
mysqlnd
pdo_mysql

5 같이 보기[편집]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}