Home IT Linux Windows Database Network Programming Server Mobile  
  Home \ Server \ Installing PHP Memcache extension under Linux     - Linux open handle limit adjustment (Linux)

- Build Golang development environment configuration on Ubuntu 14.04 (Linux)

- Linux iptables port mapping settings (Server)

- Linux installed and tested the deployment of Kafka distributed cluster (Server)

- stat Usage: Get permission to file the corresponding figures (Linux)

- RHEL5.8 physical opportunities to Read-only file system (Linux)

- Oracle Linux 5.5 (64bit) Install Oracle 11gR2 RAC detailed tutorial (Database)

- How do you turn on and off IPv6 address on Fedora (Linux)

- iOS development -Launch Image and Launchscreen (Programming)

- Linux 64-bit porting (Programming)

- SA weak password security system of the security risks posed (Linux)

- Zabbix Agent for Linux Installation and Configuration (Server)

- Sqoop data export import command (Database)

- Get basic information about Linux server script (Server)

- Switching Virtual Machine + Ubuntu graphical interface and terminal interface (Linux)

- RHEL5 multipath configuration (Linux)

- Linux kernel network subsystem analysis (Programming)

- QEMU image file used: qcow2 and raw (Linux)

- Linux System Getting Started Tutorial: How to automatically set the JAVA_HOME environment variable on Linux (Linux)

- PHP security Programming Advice (Programming)

  Installing PHP Memcache extension under Linux
  Add Date : 2018-11-21      
  Memcache job is to maintain the special machine memory a huge hash table to store some files are often read with an array, which greatly improves the efficiency of the site, reducing pressure on the back-end database to read and write.

Experimental environment: CentOS 6.6 x86_64
LAMP environment to build complete: php version 5.6.8, apache version 2.4.12
1, you need to install before installing memcached libevent support:
# Wget http://syslab.comsenz.com/downloads/linux/libevent-1.4.12-stable.tar.gz
# Tar zxvf libevent-1.4.12-stable.tar.gz
# Cd libevent-1.4.12-stable
#. / Configure --prefix = / usr / local / libevent
#make && make install

2, compiling memcached server installation
# Wget http://syslab.comsenz.com/downloads/linux/memcached-1.4.5.tar.gz
# Tar zxvf memcached-1.4.5.tar.gz
# Cd memcached-1.4.5
# ./configure --prefix = / Usr / local / memcached --with-libevent = / usr / local / libevent /
# Make && make install

3, memcache client installation steps:
# Wget http://www.lishiming.net/data/attachment/forum/memcache-2.2.3.tgz
# Tar zxvf memcache-2.2.3.tgz
# Cd memcache-2.2.3
# / Usr / local / php / bin / phpize
# ./configure --with-Php-config = / usr / local / php / bin / php-config --enable-memcache
# Make

After you do make an error as follows:
/usr/local/src/memcache-2.2.3/memcache.c: In function 'php_mmc_connect' in:
/usr/local/src/memcache-2.2.3/memcache.c:1902: Error: provided to the function 'zend_list_insert' argument too
/usr/local/src/memcache-2.2.3/memcache.c:1919: Error: provided to the function 'zend_list_insert' argument too
/usr/local/src/memcache-2.2.3/memcache.c: In function 'zif_memcache_add_server' in:
/usr/local/src/memcache-2.2.3/memcache.c:1975: Error: provided to the function 'zend_is_callable' argument too
/usr/local/src/memcache-2.2.3/memcache.c:2003: Error: provided to the function 'zend_list_insert' argument too
/usr/local/src/memcache-2.2.3/memcache.c: In function 'zif_memcache_set_server_params' in:
/usr/local/src/memcache-2.2.3/memcache.c:2059: Error: provided to the function 'zend_is_callable' argument too
/usr/local/src/memcache-2.2.3/memcache.c: In function 'mmc_find_persistent' in:
/usr/local/src/memcache-2.2.3/memcache.c:2159: Error: provided to the function 'zend_list_insert' argument too
/usr/local/src/memcache-2.2.3/memcache.c:2177: Error: provided to the function 'zend_list_insert' argument too
make: *** [memcache.lo] Error 1

Depending on the error, modify:
vi memcache.c
All: zend_list_insert (pool, le_memcache_pool);
Read: zend_list_insert (pool, le_memcache_pool TSRMLS_CC);

All: zend_list_insert (mmc, le_pmemcache);

Read: zend_list_insert (mmc, le_pmemcache TSRMLS_CC);
All speak: if (zend_is_callable (failure_callback, 0, NULL)!)
Read: if (zend_is_callable (failure_callback, 0, NULL, NULL)!)

After editing, re-make the compiler;
# Make install
Installing shared extensions: / usr / local / php / lib / php / extensions / no-debug-zts-20131226 /

After the installation is complete memcache.so module in the above path;
# Vi /usr/local/php/etc/php.ini
In the last line add: extension = "memcache.so"
Save and exit, restart apache, php -m view using memcache module has been installed, or browser access phpinfo.php view;

Start memcached server:
# / Usr / local / memcached / bin / memcached -d -u root -m 256 -p 11211 -l localhost
-d is to start a daemon,
-m Specifies memecached behind how much memory, the unit is M
-p port Specifies the start memcached
-l to specify a bind IP
-u to specify the identity of an account to start
After being given the boot, can not find libevent module;
/ Usr / local / memcached / bin / memcached: error while loading shared libraries: libevent-1.4.so.2: can not open shared object file: No such file or directory
Libevent-1.4.so.2 need to copy or link to / usr / lib64 (x86_64-bit systems, 32 is / usr / lib directory), otherwise memcached not load properly.
# Cp /usr/local/libevent/lib/libevent-1.4.so.2 / usr / lib64

memcache environmental testing, write a php file in the root directory of the site
[Root @ localhost htdocs] # cat 1.php
< ? Php
$ Mem = new Memcache;
$ Mem-> connect ( "localhost", 11211);
$ Mem-> set ( 'test', 'hello world', 0,60);
echo $ mem-> get ( 'test');

Use curl or Web access IP / 1.php If hello world configuration was successful.
# Curl -xlocalhost: 80
hello world
- SA weak password security system of the security risks posed (Linux)
- Configuring Sublime Text Python runtime environment 2 (Linux)
- Linux system security infrastructure Highlights (Linux)
- Python variable type (Programming)
- Orabbix binding Python send graphical reports (Linux)
- What is Unikernel? (Linux)
- Java thread lifecycle (Programming)
- Use Bosh deploy CloudFoundry problems encountered on OpenStack (Server)
- Through the source code to install MySQL 5.6.26 under CentOS6 (Database)
- Linux Desktop allows exceptionally different launch applications (Linux)
- How to track performance issues when using the Unity Game Development Android (Programming)
- Oracle table of nested loop connection (Database)
- Build a Linux development environment under STC89C52RC (Linux)
- Ubuntu 14.10 / 14.04 / 12.04 installation GNOME Pie 0.5.6 (Linux)
- 10 useful Linux command line tips (Linux)
- Linux server startup and logon security settings (Linux)
- Daemon under Linux (Linux)
- Using monitoring tool dsniff (Linux)
- Linux kernel modules related to the management Comments (Linux)
- Example of use WebSocket (Programming)
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.