우분투16 php-mbstring 설치

Jmnote (토론 | 기여)님의 2017년 12월 17일 (일) 20:24 판
  다른 뜻에 대해서는 우분투16 php-mbstring 설치 문서를 참조하십시오.
우분투16 php-mbstring 설치
- The requested PHP extension ext-mbstring * is missing from your system.
PHP mbstring extension missing (PHP configuration parameter --enable-mbstring).

1 확인

root@zetawiki:~# apt list php-mbstring
Listing... Done
php-mbstring/xenial,xenial 1:7.0+35ubuntu6 all
root@zetawiki:~# php -m | grep mbstring
root@zetawiki:~# php -r "mb_strlen();"
PHP Fatal error:  Uncaught Error: Call to undefined function mb_strlen() in Command line code:1
Stack trace:
#0 {main}
  thrown in Command line code on line 1

2 설치

root@zetawiki:~# apt install php-mbstring
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  php7.0-mbstring
The following NEW packages will be installed:
  php-mbstring php7.0-mbstring
0 upgraded, 2 newly installed, 0 to remove and 36 not upgraded.
Need to get 467 kB of archives.
After this operation, 1,508 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://kr.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 php7.0-mbstring amd64 7.0.15-0ubuntu0.16.04.4 [465 kB]
Get:2 http://kr.archive.ubuntu.com/ubuntu xenial/universe amd64 php-mbstring all 1:7.0+35ubuntu6 [1,940 B]
Fetched 467 kB in 0s (1,202 kB/s)        
Selecting previously unselected package php7.0-mbstring.
... (생략)
Processing triggers for php7.0-fpm (7.0.15-0ubuntu0.16.04.4) ...

3 확인 2

root@zetawiki:~# apt list php-mbstring
Listing... Done
php-mbstring/xenial,xenial,now 1:7.0+35ubuntu6 all [installed]
root@zetawiki:~# php -m | grep mbstring
mbstring
root@zetawiki:~# php -r "mb_strlen();"
PHP Warning:  mb_strlen() expects at least 1 parameter, 0 given in Command line code on line 1

4 (Optinal) 아파치 리로드

  • 웹에도 적용하려면 아파치 리로드
root@zetawiki:~# /etc/init.d/apache2 reload
[ ok ] Reloading apache2 configuration (via systemctl): apache2.service.

5 같이 보기

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