Learn about Centmin Mod LEMP Stack today
Become a Member

Sysadmin libmemcached-devel question

Discussion in 'System Administration' started by elargento, Jun 5, 2017.

  1. elargento

    elargento Member

    293
    16
    18
    Jan 4, 2016
    Ratings:
    +39
    Local Time:
    6:09 AM
    10
    I'm trying to install memcached and libmemcached in a test server running cpanel, using remi repo on centos 7;
    Code:
    wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
    sudo rpm -Uvh remi-release-7*.rpm
    sudo yum --enablerepo=remi install memcached libmemcached-devel
    Then I found another tutorial and they suggest to install memcached first and then libmemcached from https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz:
    Code:
    wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
    rpm -Uvh remi-release-7*.rpm
    yum --enablerepo=remi install memcached
    wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
    tar -xzvf libmemcached-1.0.18.tar.gz
    cd libmemcached-1.0.18
    ./configure
    make install
    
    cd ~
    git clone https://github.com/php-memcached-dev/php-memcached.git
    cd php-memcached
    git checkout php7
    /opt/cpanel/ea-php70/root/usr/bin/phpize
    ./configure --with-php-config=/opt/cpanel/ea-php70/root/usr/bin/php-config --disable-memcached-sasl
    make
    make install
    make clean
    /opt/cpanel/ea-php71/root/usr/bin/phpize
    ./configure --with-php-config=/opt/cpanel/ea-php71/root/usr/bin/php-config --disable-memcached-sasl
    make
    make install
    
    I don't understand why they use remi repo first and then they download libmemcached from launchpad.net, why they do it in that way?
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,155
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    7:09 PM
    Nginx 1.13.x
    MariaDB 5.5
    because libmemcached via yum is 1.0.16 version and probably they want tthe latest 1.0.18
     
    • Like Like x 1
  3. elargento

    elargento Member

    293
    16
    18
    Jan 4, 2016
    Ratings:
    +39
    Local Time:
    6:09 AM
    10
    so simple as that

    However I don't see memcached/libmemcached is running on phpinfo
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,155
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    7:09 PM
    Nginx 1.13.x
    MariaDB 5.5
    That's an exercise to figure out for yourself. Properly installed should show up in phpinfo

    Example this is WHM/Cpanel EA4 based server I am optimising for a paid consult job with additional litespeed web server installed. Surprised to see that cpanel/WHM system level, EA4's multi-php versions and MySQL/MariaDB config isn't anywhere near optimally configured out of the box still so definitely needs me applying my magic to the setup :) Some of the php settings that default aren't that great security wise too.

    Below is output for respective PHP 5.5, 5.6, 7.0 and 7.1 version's version command, php --ini paths for memcache, memcached and my custom ini settings for all binaries including lsphp.

    PHP 5.5
    Code (Text):
    -------------
    /opt/cpanel/ea-php55/root/usr/bin/php -v
    PHP 5.5.38 (cli) (built: May 17 2017 20:25:54)
    Copyright (c) 1997-2015 The PHP Group
    Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
        with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
    -------------
    /opt/cpanel/ea-php55/root/usr/bin/php --ini | egrep 'memcache|custom'
    /opt/cpanel/ea-php55/root/etc/php.d/memcache.ini,
    /opt/cpanel/ea-php55/root/etc/php.d/memcached.ini,
    /opt/cpanel/ea-php55/root/etc/php.d/zzz-custom.ini
    -------------
    /opt/cpanel/ea-php55/root/usr/bin/php --ri 'memcache'
    
    memcache
    
    memcache support => enabled
    Active persistent connections => 0
    Version => 2.2.7
    Revision => $Revision: 327750 $
    
    Directive => Local Value => Master Value
    memcache.allow_failover => 1 => 1
    memcache.max_failover_attempts => 20 => 20
    memcache.default_port => 11211 => 11211
    memcache.chunk_size => 8192 => 8192
    memcache.hash_strategy => standard => standard
    memcache.hash_function => crc32 => crc32
    memcache.default_timeout_ms => 1000 => 1000
    -------------
    /opt/cpanel/ea-php55/root/usr/bin/php --ri 'memcached'
    
    memcached
    
    memcached support => enabled
    Version => 2.2.0
    libmemcached version => 1.0.18
    SASL support => no
    Session support => yes
    igbinary support => no
    json support => no
    msgpack support => no
    
    Directive => Local Value => Master Value
    memcached.sess_locking => 1 => 1
    memcached.sess_consistent_hash => 0 => 0
    memcached.sess_binary => 0 => 0
    memcached.sess_lock_wait => 150000 => 150000
    memcached.sess_lock_max_wait => 0 => 0
    memcached.sess_lock_expire => 0 => 0
    memcached.sess_prefix => memc.sess.key. => memc.sess.key.
    memcached.sess_number_of_replicas => 0 => 0
    memcached.sess_randomize_replica_read => 0 => 0
    memcached.sess_remove_failed => 0 => 0
    memcached.sess_connect_timeout => 1000 => 1000
    memcached.compression_type => fastlz => fastlz
    memcached.compression_factor => 1.3 => 1.3
    memcached.compression_threshold => 2000 => 2000
    memcached.serializer => php => php
    memcached.store_retry_count => 2 => 2
    -------------
    /opt/cpanel/ea-php55/root/usr/bin/php -i | egrep 'error_log|max_execution_time|max_input_time|session.gc_maxlifetime|memory_limit|short_open_tag|realpath_cache_size|realpath_cache_ttl|upload_max_filesize|post_max_size|expose_php|max_input_nesting_level|max_input_vars|mysqlnd.net_cmd_buffer_size|always_populate_raw_post_data'
    always_populate_raw_post_data => Off => Off
    error_log => /var/log/php55-errors.log => /var/log/php55-errors.log
    expose_php => Off => Off
    max_execution_time => 0 => 0
    max_input_nesting_level => 128 => 128
    max_input_time => -1 => -1
    max_input_vars => 10000 => 10000
    memory_limit => 1024M => 1024M
    post_max_size => 20M => 20M
    realpath_cache_size => 640K => 640K
    realpath_cache_ttl => 86400 => 86400
    short_open_tag => On => On
    upload_max_filesize => 20M => 20M
    session.gc_maxlifetime => 1440 => 1440
    opcache.error_log => no value => no value
    -------------
    

    PHP 5.6
    Code (Text):
    -------------
    /opt/cpanel/ea-php56/root/usr/bin/php -v
    PHP 5.6.30 (cli) (built: May 17 2017 20:27:43)
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
        with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
    -------------
    /opt/cpanel/ea-php56/root/usr/bin/php --ini | egrep 'memcache|custom'
    /opt/cpanel/ea-php56/root/etc/php.d/memcache.ini,
    /opt/cpanel/ea-php56/root/etc/php.d/memcached.ini,
    /opt/cpanel/ea-php56/root/etc/php.d/zzz-custom.ini
    -------------
    /opt/cpanel/ea-php56/root/usr/bin/php --ri 'memcache'
    
    memcache
    
    memcache support => enabled
    Active persistent connections => 0
    Version => 2.2.7
    Revision => $Revision: 327750 $
    
    Directive => Local Value => Master Value
    memcache.allow_failover => 1 => 1
    memcache.max_failover_attempts => 20 => 20
    memcache.default_port => 11211 => 11211
    memcache.chunk_size => 8192 => 8192
    memcache.hash_strategy => standard => standard
    memcache.hash_function => crc32 => crc32
    memcached
    
    memcached support => enabled
    Version => 2.2.0
    libmemcached version => 1.0.18
    SASL support => no
    Session support => yes
    igbinary support => no
    json support => no
    msgpack support => no
    
    Directive => Local Value => Master Value
    memcached.sess_locking => 1 => 1
    memcached.sess_consistent_hash => 0 => 0
    memcached.sess_binary => 0 => 0
    memcached.sess_lock_wait => 150000 => 150000
    memcached.sess_lock_max_wait => 0 => 0
    memcached.sess_lock_expire => 0 => 0
    memcached.sess_prefix => memc.sess.key. => memc.sess.key.
    memcached.sess_number_of_replicas => 0 => 0
    memcached.sess_randomize_replica_read => 0 => 0
    memcached.sess_remove_failed => 0 => 0
    memcached.sess_connect_timeout => 1000 => 1000
    memcached.compression_type => fastlz => fastlz
    memcached.compression_factor => 1.3 => 1.3
    memcached.compression_threshold => 2000 => 2000
    memcached.serializer => php => php
    memcached.store_retry_count => 2 => 2
    -------------
    /opt/cpanel/ea-php56/root/usr/bin/php -i | egrep 'error_log|max_execution_time|max_input_time|session.gc_maxlifetime|memory_limit|short_open_tag|realpath_cache_size|realpath_cache_ttl|upload_max_filesize|post_max_size|expose_php|max_input_nesting_level|max_input_vars|mysqlnd.net_cmd_buffer_size|always_populate_raw_post_data'
    always_populate_raw_post_data => -1 => -1
    error_log => /var/log/php56-errors.log => /var/log/php56-errors.log
    expose_php => Off => Off
    max_execution_time => 0 => 0
    max_input_nesting_level => 128 => 128
    max_input_time => -1 => -1
    max_input_vars => 10000 => 10000
    memory_limit => 1024M => 1024M
    post_max_size => 20M => 20M
    realpath_cache_size => 640K => 640K
    realpath_cache_ttl => 86400 => 86400
    short_open_tag => On => On
    upload_max_filesize => 20M => 20M
    session.gc_maxlifetime => 1440 => 1440
    opcache.error_log => no value => no value
    -------------
    

    PHP 7.0
    Code (Text):
    -------------
    /opt/cpanel/ea-php70/root/usr/bin/php -v
    PHP 7.0.19 (cli) (built: May 17 2017 20:28:40) ( NTS )
    Copyright (c) 1997-2017 The PHP Group
    Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
        with Zend OPcache v7.0.19, Copyright (c) 1999-2017, by Zend Technologies
    -------------
    /opt/cpanel/ea-php70/root/usr/bin/php --ini | egrep 'memcache|custom'
    /opt/cpanel/ea-php70/root/etc/php.d/memcache.ini,
    /opt/cpanel/ea-php70/root/etc/php.d/memcached.ini,
    /opt/cpanel/ea-php70/root/etc/php.d/zzz-custom.ini
    -------------
    /opt/cpanel/ea-php70/root/usr/bin/php --ri 'memcache'
    
    memcache
    
    memcache support => enabled
    Version => 3.0.9-dev
    Revision => $Revision$
    
    Directive => Local Value => Master Value
    memcache.allow_failover => 1 => 1
    memcache.max_failover_attempts => 20 => 20
    memcache.default_port => 11211 => 11211
    memcache.chunk_size => 32768 => 32768
    memcache.protocol => ascii => ascii
    memcache.hash_strategy => consistent => consistent
    memcache.hash_function => crc32 => crc32
    memcache.redundancy => 1 => 1
    memcache.session_redundancy => 2 => 2
    memcache.compress_threshold => 20000 => 20000
    memcache.lock_timeout => 15 => 15
    -------------
    /opt/cpanel/ea-php70/root/usr/bin/php --ri 'memcached'
    
    memcached
    
    memcached support => enabled
    Version => 3.0.2
    libmemcached version => 1.0.18
    SASL support => no
    Session support => yes
    igbinary support => no
    json support => no
    msgpack support => no
    
    Directive => Local Value => Master Value
    memcached.sess_locking => 1 => 1
    memcached.sess_lock_wait_min => 1000 => 1000
    memcached.sess_lock_wait_max => 2000 => 2000
    memcached.sess_lock_retries => 5 => 5
    memcached.sess_lock_expire => 0 => 0
    memcached.sess_binary_protocol => 1 => 1
    memcached.sess_consistent_hash => 1 => 1
    memcached.sess_number_of_replicas => 0 => 0
    memcached.sess_randomize_replica_read => 0 => 0
    memcached.sess_remove_failed_servers => 0 => 0
    memcached.sess_server_failure_limit => 0 => 0
    memcached.sess_connect_timeout => 0 => 0
    memcached.sess_sasl_username => no value => no value
    memcached.sess_sasl_password => no value => no value
    memcached.sess_prefix => memc.sess. => memc.sess.
    memcached.sess_persistent => 0 => 0
    memcached.sess_lock_wait => not set => not set
    memcached.sess_lock_max_wait => not set => not set
    memcached.compression_type => fastlz => fastlz
    memcached.compression_factor => 1.3 => 1.3
    memcached.compression_threshold => 2000 => 2000
    memcached.serializer => php => php
    memcached.store_retry_count => 2 => 2
    memcached.default_consistent_hash => 0 => 0
    memcached.default_binary_protocol => 0 => 0
    memcached.default_connect_timeout => 0 => 0
    -------------
    /opt/cpanel/ea-php70/root/usr/bin/php -i | egrep 'error_log|max_execution_time|max_input_time|session.gc_maxlifetime|memory_limit|short_open_tag|realpath_cache_size|realpath_cache_ttl|upload_max_filesize|post_max_size|expose_php|max_input_nesting_level|max_input_vars|mysqlnd.net_cmd_buffer_size|always_populate_raw_post_data'
    error_log => /var/log/php70-errors.log => /var/log/php70-errors.log
    expose_php => Off => Off
    max_execution_time => 0 => 0
    max_input_nesting_level => 128 => 128
    max_input_time => -1 => -1
    max_input_vars => 10000 => 10000
    memory_limit => 1024M => 1024M
    post_max_size => 20M => 20M
    realpath_cache_size => 640K => 640K
    realpath_cache_ttl => 86400 => 86400
    short_open_tag => On => On
    upload_max_filesize => 20M => 20M
    session.gc_maxlifetime => 1440 => 1440
    opcache.error_log => no value => no value
    -------------
    

    PHP 7.1
    Code (Text):
    -------------
    /opt/cpanel/ea-php71/root/usr/bin/php -v
    PHP 7.1.5 (cli) (built: May 17 2017 20:29:27) ( NTS )
    Copyright (c) 1997-2017 The PHP Group
    Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
        with Zend OPcache v7.1.5, Copyright (c) 1999-2017, by Zend Technologies
    -------------
    /opt/cpanel/ea-php71/root/usr/bin/php --ini | egrep 'memcache|custom'
    /opt/cpanel/ea-php71/root/etc/php.d/memcache.ini,
    /opt/cpanel/ea-php71/root/etc/php.d/memcached.ini,
    /opt/cpanel/ea-php71/root/etc/php.d/zzz-custom.ini
    -------------
    /opt/cpanel/ea-php71/root/usr/bin/php --ri 'memcache'
    
    memcache
    
    memcache support => enabled
    Version => 3.0.9-dev
    Revision => $Revision$
    
    Directive => Local Value => Master Value
    memcache.allow_failover => 1 => 1
    memcache.max_failover_attempts => 20 => 20
    memcache.default_port => 11211 => 11211
    memcache.chunk_size => 32768 => 32768
    memcache.protocol => ascii => ascii
    memcache.hash_strategy => consistent => consistent
    memcache.hash_function => crc32 => crc32
    memcache.redundancy => 1 => 1
    memcache.session_redundancy => 2 => 2
    memcache.compress_threshold => 20000 => 20000
    memcache.lock_timeout => 15 => 15
    -------------
    /opt/cpanel/ea-php71/root/usr/bin/php --ri 'memcached'
    
    memcached
    
    memcached support => enabled
    Version => 3.0.2
    libmemcached version => 1.0.18
    SASL support => no
    Session support => yes
    igbinary support => no
    json support => no
    msgpack support => no
    
    Directive => Local Value => Master Value
    memcached.sess_locking => 1 => 1
    memcached.sess_lock_wait_min => 1000 => 1000
    memcached.sess_lock_wait_max => 2000 => 2000
    memcached.sess_lock_retries => 5 => 5
    memcached.sess_lock_expire => 0 => 0
    memcached.sess_binary_protocol => 1 => 1
    memcached.sess_consistent_hash => 1 => 1
    memcached.sess_number_of_replicas => 0 => 0
    memcached.sess_randomize_replica_read => 0 => 0
    memcached.sess_remove_failed_servers => 0 => 0
    memcached.sess_server_failure_limit => 0 => 0
    memcached.sess_connect_timeout => 0 => 0
    memcached.sess_sasl_username => no value => no value
    memcached.sess_sasl_password => no value => no value
    memcached.sess_prefix => memc.sess. => memc.sess.
    memcached.sess_persistent => 0 => 0
    memcached.sess_lock_wait => not set => not set
    memcached.sess_lock_max_wait => not set => not set
    memcached.compression_type => fastlz => fastlz
    memcached.compression_factor => 1.3 => 1.3
    memcached.compression_threshold => 2000 => 2000
    memcached.serializer => php => php
    memcached.store_retry_count => 2 => 2
    memcached.default_consistent_hash => 0 => 0
    memcached.default_binary_protocol => 0 => 0
    memcached.default_connect_timeout => 0 => 0
    -------------
    /opt/cpanel/ea-php71/root/usr/bin/php -i | egrep 'error_log|max_execution_time|max_input_time|session.gc_maxlifetime|memory_limit|short_open_tag|realpath_cache_size|realpath_cache_ttl|upload_max_filesize|post_max_size|expose_php|max_input_nesting_level|max_input_vars|mysqlnd.net_cmd_buffer_size|always_populate_raw_post_data'
    error_log => /var/log/php71-errors.log => /var/log/php71-errors.log
    expose_php => Off => Off
    max_execution_time => 0 => 0
    max_input_nesting_level => 128 => 128
    max_input_time => -1 => -1
    max_input_vars => 10000 => 10000
    memory_limit => 1024M => 1024M
    post_max_size => 20M => 20M
    realpath_cache_size => 640K => 640K
    realpath_cache_ttl => 86400 => 86400
    short_open_tag => On => On
    upload_max_filesize => 20M => 20M
    session.gc_maxlifetime => 1440 => 1440
    opcache.error_log => no value => no value
    -------------
    

    PHP default cli binary
    Code (Text):
    -------------
    /usr/bin/php -v
    ea-php-cli Copyright 2016 cPanel, Inc.
    PHP 5.6.30 (cgi-fcgi) (built: May 17 2017 20:27:47)
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
        with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
    php -i | egrep 'error_log|max_execution_time|max_input_time|session.gc_maxlifetime|memory_limit|short_open_tag|realpath_cache_size|realpath_cache_ttl|upload_max_filesize|post_max_size|expose_php|max_input_nesting_level|max_input_vars|mysqlnd.net_cmd_buffer_size|always_populate_raw_post_data'
    always_populate_raw_post_data => -1 => -1
    error_log => /var/log/php56-errors.log => /var/log/php56-errors.log
    expose_php => Off => Off
    max_execution_time => 0 => 0
    max_input_nesting_level => 128 => 128
    max_input_time => -1 => -1
    max_input_vars => 10000 => 10000
    memory_limit => 1024M => 1024M
    post_max_size => 20M => 20M
    realpath_cache_size => 640K => 640K
    realpath_cache_ttl => 86400 => 86400
    short_open_tag => On => On
    upload_max_filesize => 20M => 20M
    session.gc_maxlifetime => 1440 => 1440
    opcache.error_log => no value => no value
    -------------
    

    litespeed lsapi PHP cli binary
    Code (Text):
    -------------
    /usr/bin/lsphp -v
    ea-php-cli Copyright 2016 cPanel, Inc.
    PHP 5.6.30 (litespeed) (built: May 17 2017 20:29:59)
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
        with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
    -------------
    /usr/bin/lsphp -i | egrep 'error_log|max_execution_time|max_input_time|session.gc_maxlifetime|memory_limit|short_open_tag|realpath_cache_size|realpath_cache_ttl|upload_max_filesize|post_max_size|expose_php|max_input_nesting_level|max_input_vars|mysqlnd.net_cmd_buffer_size|always_populate_raw_post_data'
    always_populate_raw_post_data => -1 => -1
    error_log => /var/log/php56-errors.log => /var/log/php56-errors.log
    expose_php => Off => Off
    max_execution_time => 0 => 60
    max_input_nesting_level => 128 => 128
    max_input_time => -1 => 60
    max_input_vars => 10000 => 10000
    memory_limit => 1024M => 1024M
    post_max_size => 20M => 20M
    realpath_cache_size => 640K => 640K
    realpath_cache_ttl => 86400 => 86400
    short_open_tag => On => On
    upload_max_filesize => 20M => 20M
    session.gc_maxlifetime => 1440 => 1440
    opcache.error_log => no value => no value
    -------------
    
     
    Last edited: Jun 5, 2017