PECL stats 설치

Uncaught Error: Call to undefined function stats_cdf_binomial()
PECL stats 설치

1 확인[ | ]

jmnote@zetawiki:~$ php -r "stats_cdf_binomial();"
PHP Fatal error:  Uncaught Error: Call to undefined function stats_cdf_binomial() in Command line code:1
Stack trace:
#0 {main}
  thrown in Command line code on line 1
jmnote@zetawiki:~$ pecl list stats
`stats' not installed
jmnote@zetawiki:~$ pecl search stats
Retrieving data...0%
Matched packages, channel pecl.php.net:
=======================================
Package Stable/(Latest) Local
stats   1.0.5 (stable)        Extension with routines for statistical computation.

2 설치 (실패)[ | ]

jmnote@zetawiki:~$ sudo pecl install stats
pecl/stats requires PHP (version >= 5.3.0, version <= 5.6.99), installed version is 7.0.15-0ubuntu0.16.04.4
No valid packages found
install failed
→ pecl/stats는 PHP 버전 5.3.0~5.6.99를 지원한다. 7.0 이상을 지원하지 않는다..

3 설치 2[ | ]

jmnote@zetawiki:~$ sudo pecl install https://pecl.php.net/get/stats-2.0.3.tgz
downloading stats-2.0.3.tgz ...
Starting to download stats-2.0.3.tgz (112,280 bytes)
.........................done: 112,280 bytes
17 source files, building
running: phpize
Configuring for:
PHP Api Version:         20151012
... (생략)
665793 464 -rwxr-xr-x 1 root root 471952 Jul  3 00:19 /tmp/pear/temp/pear-build-rootsYNZXA/install-stats-2.0.3/usr/lib/php/20151012/stats.so

Build process completed successfully
Installing '/usr/lib/php/20151012/stats.so'
install ok: channel://pecl.php.net/stats-2.0.3
configuration option "php_ini" is not set to php.ini location
You should add "extension=stats.so" to php.ini
jmnote@zetawiki:~$ pecl list | grep stats
stats   2.0.3   stable

4 PHP 설정 추가[ | ]

jmnote@zetawiki:~$ php -i | grep conf.d | head -3
Scan this dir for additional .ini files => /etc/php/7.0/cli/conf.d
Additional .ini files parsed => /etc/php/7.0/cli/conf.d/10-mysqlnd.ini,
/etc/php/7.0/cli/conf.d/10-opcache.ini,
jmnote@zetawiki:~$ sudo sh -c 'echo extension=stats.so > /etc/php/7.0/cli/conf.d/stats.ini'
jmnote@zetawiki:~$ cat /etc/php/7.0/cli/conf.d/stats.ini
extension=stats.so

5 확인 2[ | ]

jmnote@zetawiki:~$ php -r "stats_cdf_binomial();"
PHP Warning:  stats_cdf_binomial() expects exactly 4 parameters, 0 given in Command line code on line 1
jmnote@zetawiki:~$

6 참고[ | ]

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