: This article mainly introduces some extensions for running the YII2 framework in Ubuntu. For more information about PHP tutorials, see. Intl extension (PHP intl is an international extension and a package for the ICU database .)
sudo apt-get install php5-intl
sudo service apache2 restart
PDO SQLite extension
sudo apt-get install php5-sqlite
sudo service apache2 restart
PDO PostgreSQL extension
sudo apt-get install php5-pgsql
service apache2 restart
Memcache
Memcache is divided into two parts: Memcache server and client. The Memcache server runs as a service. The creation, storage, and deletion of all data caches are actually completed here. The client here refers to the extensions that PHP can call.
Sudoapt-get install memcached
After installing the Memcache server, we need to start the service:
Memcached-d-m 128-p 11211-u root
Here we need to describe the memcached service startup parameters:
-P listening port
-L connected IP address. the default value is local
-Dstart starts the memcached service.
-Drestart: Restart the memcached service.
-Dstop | shutdown: shut down the running memcached service.
-Dinstall install the memcached service
-Duninstall uninstall the memcached service
-U runs as the identity (only valid when running as root)
-MB maximum memory usage, in MB. The default value is 64 MB.
-An error is returned when M memory is used up, instead of deleting items.
-C: maximum number of simultaneous connections. the default value is 1024.
-F block size growth factor. the default value is 1.25-n. the minimum allocation space is 48 for key + value + flags.
-H Show Help 2) install the Memcache Client
Memcache extension
sudo apt-get install php5-memcache
Test:
$mem = new Memcache;$mem->connect("127.0.0.1", 11211);$mem->set('key', 'This is a memcached test!', 0, 60);$val = $mem->get('key');echo $val;
APC extension
sudo apt-get install php-apc
Will prompt installation
php5-
apcu php-apc
Direct
y
ImageMagick PHP extension
sudo apt-get install imagemagick libmagickwand-dev
sudo pecl install imagick
sudo echo "extension=imagick.so" >> /etc/php5/apache2/php.ini
sudo /etc/init.d/apache2 restart
The above introduces some extensions for running the YII2 framework in Ubuntu environment, including some content, and hope to be helpful to friends who are interested in PHP tutorials.