php setop,PHP Setup

Setup

The plugin is implemented as a PHP extension. See also the

installation instructions to

install this extension.

Compile or configure the PHP MySQL extension (API) (mysqli,

PDO_MYSQL, mysql).

That extension must use the mysqlnd library as

because mysqlnd_memcache is a plugin for the mysqlnd library. For additional information,

refer to the mysqlnd_memcache installation instructions.

Then, load this extension into PHP and activate the plugin in the PHP configuration

file using the PHP configuration directive named

mysqlnd_memcache.enable.

Example #1 Enabling the plugin (php.ini)

; On Windows the filename is php_mysqnd_memcache.dll

; Load the extension

extension=mysqlnd_memcache.so

; Enable it

mysqlnd_memcache.enable=1

Follow the instructions given in the » MySQL

Reference Manual on installing the Memcache plugins for the MySQL server. Activate

the plugins and configure Memcache access for SQL tables.

The examples in this quickguide assume that the following table exists, and that

Memcache is configured with access to it.

Example #2 SQL table used for the Quickstart

CREATE TABLE test(

id CHAR(16),

f1 VARCHAR(255),

f2 VARCHAR(255),

f3 VARCHAR(255),

flags INT NOT NULL,

cas_column INT,

expire_time_column INT,

PRIMARY KEY(id)

) ENGINE=InnoDB;

INSERT INTO test (id, f1, f2, f3) VALUES (1, 'Hello', 'World', '!');

INSERT INTO test (id, f1, f2, f3) VALUES (2, 'Lady', 'and', 'the tramp');

INSERT INTO innodb_memcache.containers(

name, db_schema, db_table, key_columns, value_columns,

flags, cas_column, expire_time_column, unique_idx_name_on_key)

VALUES (

'plugin_test', 'test', 'test', 'id', 'f1,f2,f3',

'flags', 'cas_column', 'expire_time_column', 'PRIMARY KEY');

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值