腾讯CMEM的PHP扩展编译安装方法
这篇文章主要介绍了腾讯CMEM的PHP扩展编译安装方法,较为详细的分析了CMEM的功能、作用及安装使用技巧,具有一定参考借鉴价值,需要的朋友可以参考下
本文实例讲述了腾讯CMEM的PHP扩展编译安装方法。分享给大家供大家参考。具体如下:
CMEM是什么?
CMEM全称为Cloud Memory,是腾讯提供的高性能内存级持久化存储服务,适用于数据量小、访问量高、key-value存储的场景。
CMEM基于一个存储键/值对的hashmap,数据使用内存存储,并保证数据的持久性。
CMEM PHP Extension是什么?
CMEM基于标准的Memcached协议以及接口,,只是将数据获取接口增加返回值设定。
Memcached的Get协议没有设计返回码,所以Memcached API返回NO_DATA时,有可能是网络原因造成的,不能完全信任。 使用如下流程将是非常危险的,将造成用户数据初始化:
if(NO_DATA) { InitData(); }
为解决上述问题,CMEM提供了Memcahced文本扩展协议,增加两个扩展的命令get_ext, gets_ext,使客户端可以根据返回码判断数据是否存在。 这样可以避免网络和设备故障时get不到数据而导致用户数据被误初始化。
CMEM编译与安装
# 下载CMEM cd /home/src wget # 解压 tar zxvf cmem-2.2.6.tar.gz cd cmem-2.2.6 # 编译 /usr/local/webserver/php/bin/phpize ./configure --with-php-config=/usr/local/webserver/php/bin/php-config make # 安装PHP扩展 cp modules/cmem.so /usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20090626/ # 配置php.ini # 加入以下内容 # -------------------------------------------------- extension = "cmem.so" # -------------------------------------------------- # 测试 # 新建cmemtest.php cat > /tmp/cmemtest.php # 代码为 # -------------------------------------------------- # -------------------------------------------------- # 执行测试文件 /usr/local/webserver/php/bin/php -f /tmp/cmemtest.php
希望本文所述对大家的php程序设计有所帮助。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



You can check which extensions are used by PHP by viewing the phpinfo() function output, using command line tools, and checking the PHP configuration file. 1. View the phpinfo() function output, create a simple PHP script, save this script as phpinfo.php, and upload it to your web server. Access this file in the browser and use the browser's search function. Just look for the keyword "extension" or "extension_loaded" on the page to find information about the extension.

Regarding the default version number of GCC installed through yum under CentOS, CentOS5 is 4.1.2; CentOS6 is 4.4.7; CentOS7 is 4.8.3. Many times, a higher version of GCC is required when compiling and installing software, otherwise an error will be reported. So how to upgrade the GCC version? First, confirm the GCC version number you upgraded to. At present, the latest version of GCC has reached 5.2, and CentOS7 still uses its 4.8, so based on compatibility considerations, I chose to upgrade to 4.8.5. GCC official website: https://gcc.gnu.org Let’s start step by step to compile and install GCC4.8.5. It should be noted that before compiling and installing GCC, the system

How to use PHP to extend the report generation function of SuiteCRM SuiteCRM is a powerful open source CRM system that provides rich functions to help enterprises manage customer relationships. One of the important functions is report generation. Using reports can help enterprises better understand their business situations and make correct decisions. This article will introduce how to use PHP to extend the report generation function of SuiteCRM and provide relevant code examples. Before starting, you need to make sure that SuiteCRM is installed.

How to use PHP to extend PDO to connect to Oracle database Introduction: PHP is a very popular server-side programming language, and Oracle is a commonly used relational database management system. This article will introduce how to use PHP extension PDO (PHPDataObjects) to connect to Oracle database. 1. Install the PDO_OCI extension. To connect to the Oracle database, you first need to install the PDO_OCI extension. Here are the steps to install the PDO_OCI extension: Make sure

When developing with PHP, we may need to use some PHP extensions. These extensions can provide us with more functions and tools, making our development work more efficient and convenient. But before using these extensions, we need to install them first. This article will introduce you to how to install PHP extensions. 1. What is a PHP extension? PHP extensions refer to components that provide additional functionality and services to the PHP programming language. These components can be installed and used through PHP's extension mechanism. PHP extension can help us with

PHP is a popular server-side scripting language that can handle dynamic content on web pages. The geoip extension for PHP allows you to get information about the user's location in PHP. In this article, we’ll cover how to use PHP’s geoip extension. What is the GeoIP extension for PHP? The geoip extension for PHP is a free, open source extension that allows you to obtain data about IP addresses and location information. This extension can be used with the GeoIP database, a database developed by MaxMin

Pagoda Panel is an open source server management panel. While providing website operators with convenient website management, database management, SSL certificate management and other services, it also provides powerful PHP extension and PHP version management functions, making server management easier. Be more simple and efficient. 1. PHP extension PHP extension is a module used to enhance PHP functions. By installing PHP extensions, more functions and services can be implemented, such as: accelerator: accelerator can significantly improve PHP performance, and reduce service load by caching PHP scripts.

PHP extension development is the art of creating custom functionality, extending PHP core functionality and building more powerful applications. It opens up new possibilities in the PHP world, allowing developers to transcend the basic limitations of the language. This article will take you on a journey of PHP extension development, providing you with comprehensive knowledge and practical guidance from basic concepts to advanced techniques. PHP extension development basics Before starting PHP extension development, you need to understand some basic concepts. What are PHP extensions? A PHP extension is a dynamic link library (DLL) that extends PHP core functionality and provides new data types, functions and classes. Advantages of PHP Extensions PHP extensions have many advantages, including: scalability, flexibility, performance optimization, and code reuse. PHP
