우분투16 php-bcmath 설치

Jmnote (토론 | 기여)님의 2017년 9월 23일 (토) 23:43 판 (새 문서: ==개요== ;우분투 bcmath 설치 ;우분투 php-bcmath 설치 ;PHP bcmath extension missing (PHP configuration parameter --enable-bcmath). ;<nowiki>PHP Fatal error: Uncaught Error...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요

우분투 bcmath 설치
우분투 php-bcmath 설치
PHP bcmath extension missing (PHP configuration parameter --enable-bcmath).
PHP Fatal error: Uncaught Error: Call to undefined function bcadd()
root@zetawiki:~# php -r 'echo bcadd("1", "2");'
PHP Fatal error:  Uncaught Error: Call to undefined function bcadd() in Command line code:1
Stack trace:
#0 {main}
  thrown in Command line code on line 1

2 확인

  • PHP 버전 확인
root@zetawiki:~# php --version
PHP 7.0.22-0ubuntu0.16.04.1 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.22-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies
  • 설치가능 패키지 확인
root@zetawiki:~# apt search bcmath
Sorting... Done
Full Text Search... Done
php-bcmath/xenial,xenial 1:7.0+35ubuntu6 all
  Bcmath module for PHP [default]

php7.0-bcmath/xenial-updates,xenial-security 7.0.22-0ubuntu0.16.04.1 amd64
  Bcmath module for PHP
→ 여기서 PHP 버전과 맞는 패키지는 'php7.0-bcmath'

3 설치

root@zetawiki:~# apt install php7.0-bcmath
... (생략)
Creating config file /etc/php/7.0/mods-available/bcmath.ini with new version
Processing triggers for libapache2-mod-php7.0 (7.0.22-0ubuntu0.16.04.1) ...###...........] 
Processing triggers for php7.0-fpm (7.0.22-0ubuntu0.16.04.1) ...

4 확인 2

root@zetawiki:~# php -r 'echo bcadd("1", "2");'
3
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}