Home IT Linux Windows Database Network Programming Server Mobile  
  Home \ Server \ Installing PHP Memcache extension under Linux     - React Getting Started Tutorial (Linux)

- MySQL monitoring tools -orzdba (Database)

- Linux cron job (Linux)

- Shell for loop (Programming)

- Ubuntu deployment Flask + UWSGI + Nginx Comments (Server)

- Installation salt-minion on RHEL5 (Linux)

- How do I delete a NEEDS RECOVERY rollback state of undo tablespace (Database)

- Java annotations entry automatically generates SQL statements (Programming)

- Android Studio Getting Started Hello World (Programming)

- Cache implementation APP interacts with the server-side interface control Session (Server)

- A simple shell script for monitoring in Linux (Linux)

- installation process of Matlab 2012a under Ubuntu 14.04 (Linux)

- Golang use Oracle database on Ubuntu 14.04 (Linux)

- Configuring LIDS build Linux kernel security intrusion detection system (Linux)

- Oracle 11g How dataguard master repository to Oracle single instance data recovery (Database)

- redis main building and disaster recovery from a cluster deployment (Database)

- Python2 ---- function using dictionaries (Programming)

- JavaScript object - Flexible and dangerous (Programming)

- GAMIT 10.50 installed in Ubuntu 12.04 system (Linux)

- Recent Consolidation Using Linux security module (Linux)

  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
- C # dynamic class notes --- (Dynamic) Applications (Programming)
- Rely on IP chain established Linux firewall (Linux)
- Shared directory settings between Linux and Linux (Linux)
- Setting Derby as Linux / Windows running as a service from the start (Server)
- JDK comes with tools JPS (Linux)
- Linux system man help tips (Linux)
- How to view the Linux graphics hardware information (Linux)
- Linux file and directory management - ls, cp, mv (Linux)
- MySQL Basic tutorial: About varchar (N) (Database)
- Use mod_wsgi Django application deployment (Server)
- VMware Workstation + Ubuntu 10.04 Download the Android 2.2 source code (Linux)
- HTTP and FTP TCP-FLOOD CC Attacks Analysis and Prevention solutions under CentOS 6.5 (Linux)
- VNC connection VMware vSphere ESXi 5.5 (Linux)
- Squid proxy server (Server)
- Scope of variables in Object-C (Programming)
- Recovery from MySQL master data consistency summary (Database)
- Use Aptik Battery Monitor monitoring Ubuntu laptop battery usage (Linux)
- Bash Automated Customization Linux belongs to its own CentOS system (Linux)
- JavaScript original values and complex values (Programming)
- C language macro definition #define Usage (Programming)
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.