The PHP stats extension provides functions for statistical computations.
To install this extension on PHP 7.X, SSH into your server as root and run the following commands:
sudo apt-get -y install gcc make autoconf libc-dev pkg-config sudo pecl7.X-sp install stats-2.0.3 sudo bash -c "echo extension=stats.so > /etc/php7.X-sp/conf.d/stats.ini" sudo service php7.X-fpm-sp restart
To install this extension on PHP 5.X, SSH into your server as root and run the following commands:
sudo apt-get -y install gcc make autoconf libc-dev pkg-config sudo pecl5.X-sp install stats-1.0.5 sudo bash -c "echo extension=stats.so > /etc/php5.X-sp/conf.d/stats.ini" sudo service php5.X-fpm-sp restart
You can verify the stats extension is installed by running this command:
phpX.Y-sp -i | grep stats
You should see the following output:
/etc/phpX.Y-sp/conf.d/stats.ini, stats
To uninstall this extension, as root run the commands:
sudo rm /etc/phpX.Y-sp/conf.d/stats.ini sudo peclX.Y-sp uninstall stats
Next, restart PHP-FPM with the command:
sudo service phpX.Y-fpm-sp restart