search
Homephp教程php手册Ubuntu 环境下运行YII2框架的一些扩展,ubuntuyii2

Ubuntu 环境下运行YII2框架的一些扩展,ubuntuyii2

 Intl extension(PHP intl 是国际化扩展,是ICU 库的一个包装器。)

sudo apt-get install php5-intl

<span lang="en-US"><code>sudo service apache2 restart</code></span>

<span lang="en-US"><code>PDO SQLite extension</code></span>
<span lang="en-US"><code>sudo apt-get install php5-sqlite </code></span>
<span lang="en-US"><code>sudo service apache2 restart</code></span>

<span lang="en-US"><code>PDO PostgreSQL extension</code></span>
<span lang="en-US"><code>sudo apt-get install php5-pgsql</code></span>
<span lang="en-US"><code>service apache2 restart</code></span>

<span lang="en-US"><code>Memcache</code></span>

  Memcache分为两部分,Memcache服务端和客户端。Memcache服务端是作为服务来运行的,所有数据缓存的建立,存储,删除实际上都是在这里完成的。客户端,在这里我们指的是PHP的可以调用的扩展。



  sudo apt-get install memcached

  
安装完Memcache服务端以后,我们需要启动该服务:

  memcached -d -m 128 -p 11211 -u root


  
这里需要说明一下memcached服务的启动参数:

  -p
监听的端口
  -l
连接的IP地址, 默认是本机
  -d start
启动memcached服务
  -d restart
重起memcached服务
  -d stop|shutdown
关闭正在运行的memcached服务
  -d install
安装memcached服务
  -d uninstall
卸载memcached服务
  -u
以的身份运行 (仅在以root运行的时候有效)
  -m
最大内存使用,单位MB。默认64MB
  -M
内存耗尽时返回错误,而不是删除项
  -c
最大同时连接数,默认是1024
  -f
块大小增长因子,默认是1.25-n 最小分配空间,key+value+flags默认是48
  -h
显示帮助2)安装Memcache客户端 

 

<span lang="en-US"><code>Memcache extension</code></span>
<span lang="en-US"><code>sudo apt-get install php5-memcache</code></span>
<br />测试一下:
$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;

  

<br />

<span lang="en-US"><code>APC extension</code></span>
<span lang="en-US"><code>sudo apt-get install php-apc</code></span>
<code>会提示安装 </code><span lang="en-US"><code>php5-</code><code>apcu php-apc </code></span><code>直接</code><span lang="en-US"><code>y</code></span>

<span lang="en-US"><code>ImageMagick PHP extension </code></span>
<span lang="en-US"><code>sudo apt-get install imagemagick libmagickwand-dev</code></span>

<span lang="en-US"><code>sudo pecl install imagick</code></span>
<span lang="en-US"><code>sudo echo "extension=imagick.so" >> /etc/php5/apache2/php.ini</code></span>
<span lang="en-US"><code>sudo /etc/init.d/apache2 restart</code></span>

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools