( ! ) Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/lib/menu/GKBase.class.php on line 114
Call Stack
#TimeMemoryFunctionLocation
10.0007415392{main}( ).../index.php:0
20.09184720536Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.405017250216Joomla\CMS\Application\SiteApplication->render( ).../CMSApplication.php:202
40.405117250272Joomla\CMS\Application\SiteApplication->render( ).../SiteApplication.php:778
50.405117250648Joomla\CMS\Document\HtmlDocument->parse( ).../CMSApplication.php:1030
60.405117250648Joomla\CMS\Document\HtmlDocument->_fetchTemplate( ).../HtmlDocument.php:545
70.405317250744Joomla\CMS\Document\HtmlDocument->_loadTemplate( ).../HtmlDocument.php:730
80.405617290664require( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/component.php' ).../HtmlDocument.php:668
90.409017587936GKTemplate->__construct( ).../component.php:31
100.416017772320GKTemplateMenu->getMenuType( ).../gk.framework.php:84
110.416517817176require_once( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/lib/menu/GKMenu.php' ).../helper.menu.php:19

( ! ) Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/lib/menu/GKHandheld.php on line 76
Call Stack
#TimeMemoryFunctionLocation
10.0007415392{main}( ).../index.php:0
20.09184720536Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.405017250216Joomla\CMS\Application\SiteApplication->render( ).../CMSApplication.php:202
40.405117250272Joomla\CMS\Application\SiteApplication->render( ).../SiteApplication.php:778
50.405117250648Joomla\CMS\Document\HtmlDocument->parse( ).../CMSApplication.php:1030
60.405117250648Joomla\CMS\Document\HtmlDocument->_fetchTemplate( ).../HtmlDocument.php:545
70.405317250744Joomla\CMS\Document\HtmlDocument->_loadTemplate( ).../HtmlDocument.php:730
80.405617290664require( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/component.php' ).../HtmlDocument.php:668
90.409017587936GKTemplate->__construct( ).../component.php:31
100.418317945504GKTemplateMenu->getMenuType( ).../gk.framework.php:85
centos memcached php 5.2.17 ius repo
Logo
Print this page

centos memcached php 5.2.17 ius repo

1 安装 IUS repo  自动打开  rpel

 

2.

yum install -y memcached

 

3.

yum install -y gcc make 

 

4.

service memcached start
chkconfig memcached on

pecl install memcache

 

5

php.ini

添加 

 

extension="memcache.so"

 

 

 

Configure Memcached

The most important value to configure is CACHESIZE. For example following configuration shows 512MB memory for Memcached. Edit /etc/sysconfig/memcached file, enter:

# vi /etc/sysconfig/memcached

Sample Output:

PORT="11211" USER="memcached" MAXCONN="1024" CACHESIZE="512" OPTIONS=""

For high traffic websites you need to increase the following values:

  1. MAXCONN : Set 1024 max simultaneous connections. For high traffic websites increase this value as per requirement.
  2. CACHESIZE : Set 512MB max memory. For high traffic websites you can set it to 1GB.
  3. OPTIONS : Set server IP address so that Apache/php/nginx based server can connect to the server.

My sample updated file:

PORT="11211" USER="memcached" MAXCONN="4096" CACHESIZE="512" OPTIONS="-l 192.168.1.1"

 

How To Start and Stop Memcached

Try the all following commands:

# chkconfig memcached on
# /etc/init.d/memcached start
# /etc/init.d/memcached stop
# /etc/init.d/memcached restart
# /etc/init.d/memcached status

 

Verify Memcached is Running and Working

Run following command to verify if it is running or not.

# netstat -tulpn | grep :11211

Sample Output:

 tcp 0 0 0.0.0.0:11211 0.0.0.0:* LISTEN 19796/memcached tcp 0 0 :::11211 :::* LISTEN 19796/memcached udp 0 0 0.0.0.0:11211 0.0.0.0:* 19796/memcached udp 0 0 :::11211 :::* 19796/memcached 

Use the memcached-tool to get general stats of server:

# memcached-tool 192.168.1.1 stats

 

Configure Firewall for Memcached

Protect memcached server by allowing access to your own servers. Edit/etc/sysconfig/iptables and append the following rules.

## only accept connection to tcp/udp port 11211 if ip is between 192.168.1.1 and 192.168.1.10 ##
# iptables -A INPUT -p tcp --destination-port 11211 -m state --state NEW -m iprange --src-range 192.168.1.1-192.168.1.10 -j ACCEPT
# iptables -A INPUT -p udp --destination-port 11211 -m state --state NEW -m iprange --src-range 192.168.1.1-192.168.1.10 -j ACCEPT

 

Restart Iptables Firewall

Type the following command to restart iptables.

# service iptables restart
## OR ##
# /etc/init.d/iptables restart

 

Test Remote Connection

Try the following command from remote server to test Memcached is listening or not.

# echo stats | netstat 192.168.1.1 -tulpn | grep :11211

Sample Output:

 tcp 0 0 0.0.0.0:11211 0.0.0.0:* LISTEN 19796/memcached tcp 0 0 :::11211 :::* LISTEN 19796/memcached udp 0 0 0.0.0.0:11211 0.0.0.0:* 19796/memcached udp 0 0 :::11211 :::* 19796/memcached 

 

Install Memcached PHP Module

 

# yum install php-pecl-memcache

 

Install Memcached Perl Module

 

# yum install perl-Cache-Memcached

 

Install Memcached Python Module

 

#  yum install python-memcached

 

Restart Web Server

 

# /etc/init.d/httpd restart
## OR ##
service httpd restart

For more information visit memcached project.

Last modified onSaturday, 05 January 2013 13:10

( ! ) Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 169
Call Stack
#TimeMemoryFunctionLocation
10.0007415392{main}( ).../index.php:0
20.09184720536Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.09184720536Joomla\CMS\Application\SiteApplication->doExecute( ).../CMSApplication.php:196
40.307812448768Joomla\CMS\Application\SiteApplication->dispatch( ).../SiteApplication.php:233
50.308512473176Joomla\CMS\Component\ComponentHelper::renderComponent( ).../SiteApplication.php:194
60.309512528504Joomla\CMS\Component\ComponentHelper::executeComponent( ).../ComponentHelper.php:377
70.309712557328require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ).../ComponentHelper.php:402
80.318212992736K2ControllerItem->execute( ).../k2.php:64
90.318212992736K2ControllerItem->display( ).../BaseController.php:710
100.327013717936K2ControllerItem->display( ).../item.php:78
110.327013717936K2ControllerItem->display( ).../controller.php:19
120.330814114304Joomla\CMS\Cache\Controller\ViewController->get( ).../BaseController.php:663
130.333414134672K2ViewItem->display( ).../ViewController.php:102
140.399417161136K2ViewItem->display( ).../view.html.php:742
150.399417161136K2ViewItem->loadTemplate( ).../HtmlView.php:230
160.401017341336include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ).../HtmlView.php:701

( ! ) Notice: Only variables should be assigned by reference in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 478
Call Stack
#TimeMemoryFunctionLocation
10.0007415392{main}( ).../index.php:0
20.09184720536Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.09184720536Joomla\CMS\Application\SiteApplication->doExecute( ).../CMSApplication.php:196
40.307812448768Joomla\CMS\Application\SiteApplication->dispatch( ).../SiteApplication.php:233
50.308512473176Joomla\CMS\Component\ComponentHelper::renderComponent( ).../SiteApplication.php:194
60.309512528504Joomla\CMS\Component\ComponentHelper::executeComponent( ).../ComponentHelper.php:377
70.309712557328require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ).../ComponentHelper.php:402
80.318212992736K2ControllerItem->execute( ).../k2.php:64
90.318212992736K2ControllerItem->display( ).../BaseController.php:710
100.327013717936K2ControllerItem->display( ).../item.php:78
110.327013717936K2ControllerItem->display( ).../controller.php:19
120.330814114304Joomla\CMS\Cache\Controller\ViewController->get( ).../BaseController.php:663
130.333414134672K2ViewItem->display( ).../ViewController.php:102
140.399417161136K2ViewItem->display( ).../view.html.php:742
150.399417161136K2ViewItem->loadTemplate( ).../HtmlView.php:230
160.401017341336include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ).../HtmlView.php:701
Template Design © Joomla Templates | GavickPro. All rights reserved.