I'm trying to install the PHP statistics package on my Ubuntu 16.04 LTS server, and I'm stuck.
First off, config stuff:
$ apache2 -v
Apache/2.4.18 (Ubuntu)
$ php -v
PHP 7.0.15-0ubuntu0.16.04.4 (cli) ( NTS )
$ pear -V
PEAR Version: 1.10.1
I have successfully added pear using apt-get as well as php-all-dev
.
When I try to install the stats package with pecl, I get the following:
$ pecl install stats
pecl/stats is already installed and is the same as the released version 1.0.5
I have also added extension=stats.so
to my php.ini
and restarted apache.
But when I try to run any of the stats functions, I get the following error:
Fatal error: Uncaught Error: Call to undefined function stats_standard_deviation() in /var/www/html/testing/stats_library.php:14 Stack trace: #0 {main} thrown in /var/www/html/testing/stats_library.php on line 14
What am I missing?
php -m
orphpinfo();
to see if the extension is actually loaded. – Satephp -m
orphpinfo();
. I edited/etc/php/7.0/apache2/php.ini
. Which one should I edit? – Detachedphpinfo();
uses theapache2/php.ini
andphp -i
uses/etc/php/7.0/cli/php.ini
. I addedextension=stats.so
to the cli ini, with no success. – Detachedpecl channel-update pecl.php.net
and got the following error:PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/stats.so' - /usr/lib/php/20151012/stats.so: cannot open shared object file: No such file or directory in Unknown on line 0
-- Shouldn'tpecl install
have created a stats.so file? – Detached