Mac OSX 10.9.5, PHP5.4 installation memcached

Source: Internet
Author: User

Mac installation memcached

MAC installation memcached installation environment

Mac OSX 10.9.5 Mavericks

PHP5.4

Using homebrew

installation process

First use Brew to find the relevant software to install

Brew Install memcached

Structure for

libmemcached php53-memcached php55-memcachedmemcached php54-memcached php56-memcached

And then click Install

Brew Install memcached Brew install Php54-memcachedbrew install libmemcached

The libmemcached installed here is 1.0.18 Version, 1.0.17 version seems incompatible with Mac OSX 10.9

The version of libmemcached in the current brew can be viewed through VIM/USR/LOCAL/LIBRARY/FORMULA/LIBMEMCACHED.RB



Finally added in the php.ini

Extension=memcached.so


Start the memcached command

memcached-d default parameter start

Memcached-d-M 1024-l 127.0.0.1-p 11211

Start parameter Description:

    • The-D option is to start a daemon,

    • -M is the amount of memory allocated to Memcache, in megabytes, default 64MB

    • -M return error on memory exhausted (rather than removing items)

    • -U is the user running memcache, and if it is currently root, you need to specify the user with this parameter.

    • -L is the server IP address of the listener, which defaults to all network cards.

    • -P is the port that sets the TCP listener for memcache, preferably a port above 1024

    • The-c option is the maximum number of concurrent connections that are running, by default 1024

    • -P is a PID file that is set to save Memcache

    • -F

      Chunk size growth factor (default:1.25)

    • -I Override the size of each slab page. Adjusts max item size (new 1.4.2 version) can also start multiple daemons, but ports cannot be duplicated

Test program
<?php $mem = new Memcached (), $news _content = "news content"; $mem->addserver ("127.0.0.1", 11211); $get _news = $mem-& Gt;get ("news_123"), if ($get _news) {echo "cache content". $get _news;}    else{$mem->set ("news_123", $news _content, 10); echo "Original content". $news _content;}? >

Mac OSX 10.9.5, PHP5.4 installation memcached

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.