I'm trying to create a connection from my PHP application to Memcache, however I keep getting the error 'Could not establish Memcached connection'.
Here's my package version information
Laravel Version: 5.0.32
PHP Version:5.4.39-0+deb7u2
Database Driver & Version:mysql Ver 14.14 Distrib 5.5.31
Server&Version :Debian:7.1.
-memcached:1.4.13-0.2
-php5-memcached:2.0.1-6
I have ensured that memcached is running, as executing service memcached status yields "memcached is running".
I have two servers where my project is deployed:
ubuntu, with memcached:2.1.0 installed
debian, with memcached:2.0.1 installed
Is there a version conflict?
Fixed by myself.
My solution as follow:
1.delete memcache file and apc file in config dir
2.restart php5-fpm and memcached service.
Although issue is fixed, but I'm still not figure out why it was triggered.
This issue only occurs on the server with Debian os installed rather than the other server which with ubuntu os installed.
Hope help somebody~
i solved the problem with
sudo apt-get install memcached
sudo service memcached status
sudo service memcached start
You need to first install memcached :
sudo apt install memcached
Then you need to start it :
sudo service memcached start
After that it will connect. I resolve it by above step in my case.
Related
I have a local WP site that depends on Memcached. The readme says "Use memcached and the PECL memcache extension to provide a backing store for the WordPress object cache."
As a far as I can tell, my config meets those requirements. But when I attempt to access the application, I get:
Fatal error: Uncaught Error: Class 'Memcache' not found in. . .
I'm running php 7.3 installed via Homebrew, and Memcached 3.1.3, installed via PECL. Memcached 3.1.3 says it's compatible with php 7.3, and I followed these instructions to add Memcache as an extension to my php server. If I start php via Homebrew, I can see the Memcache process when I run ps -ef | grep -i memcached, and the config appears when I run php --info | grep memcached\\. But, I can't connect to Memcached through my Valet app or through Telnet.
If I run Memcached through Homebrew, I get a different version, 1.5.13, which I think predates php 7.3. As I understand Homebrew only installs stable releases. When the Homebrew Memcache is running I can connect via Telnet, but not through the Valet app.
What's different about the Homebrew install of Memcached? I assume Homebrew must somehow make Memcache externally accessible but I don't know what's going on behind the scenes.
Worked for me:
brew install libmemcached
brew install pkg-config
pecl install memcached
Push Enter to all question
Then:
cd /usr/local/etc/php/7.3
sudo vim php.ini
[memcached]
extension=/usr/local/Cellar/php/7.3.5/pecl/20180731/memcached.so
Replace path parts accordingly to your system
Finally:
brew services restart php
php -m
Trying to install redis extensions for php 7.0 on my high sierra apache.
brew install php-redis - doesn't work.
brew install php#7.0-redis - doesn't work.
brew install php70-redis - doesn't work.
google google google - Homebrew is the wrong approach, use pecl, they say.
pecl search redis shows:
redis 4.0.2 (stable) 4.0.2 PHP extension for interfacing with Redis
so pecl install redis
pecl/redis is already installed and is the same as the released version 4.0.2
install failed
hmm. that's right. And I've put in the reference to the ini file:
cat /usr/local/etc/php/7.0/conf.d/ext-redis.ini
[redis]
extension="/usr/local/lib/php/pecl/20160303/redis.so"
sudo service apachectl -k restart
check phpinfo() - no mention of redis but it does state that it is loading at the ext-redis.ini file.
Definately not loading, since if I try to use it on a php page I get
Fatal error: Uncaught phpFastCache\Exceptions\phpFastCacheDriverCheckException: Redis is not installed or is misconfigured, cannot continue.
What are the steps for getting redis connected in php on macos in 2018?
I was struggling with same issue my issue is solved with bellow steps.
git clone https://www.github.com/phpredis/phpredis.git
cd phpredis
phpize && ./configure && make && sudo make install
Add extension=redis.so in your php.ini
my php.ini path is this you can find php.ini path through phpinfo();/usr/local/etc/php/7.0/php.ini
restart your php
brew services restart php#7.0
run make test.
Redis support is enable .Now you can view in phpinfo()
You may want to use "Predis" instead of "Redis" which is an applicative client designed for people that can't make use of php "Redis" extension. However your Redis service must be running and listening for internal connections.
Does upgrading from ubuntu 14.04 to 16.04 affect multi-server memcached?
I have a Laravel 5.1 application which utilizes memcached to manage sessions across multiple servers, specifically two web servers and a database server.
After upgrading the OS on each server from ubuntu 14.04 to 16.04 and installing the latest version of mariadb (10.1.*), our laravel application now returns the following error:
[RuntimeException]
No Memcached servers added.
My config files have not changed and neither have the ip addresses of any of the servers. Debugging laravel's MemcachedConnector.phpshows the server details being passed to the Memcached class but the output of Memcached::getVersion() returns false.
I am at a loss as to why this has suddenly stopped working, any assitance would be appreciated.
Make sure that your 16.04 installation has a "memcached" package:
dpkg -s memcached
If you see a message "dpkg-query: package 'memcached' is not installed and no information is available", install it by
sudo apt-get install memcached
i am unable to install lamp or xampp server on my BBB.when i typed
sudo apt-get install apache2
it says "sudo :command not found"
opkg install php php-cgi php-cli
opkg install lighttpd lighttpd-module-fastcgi
opkg install mysql5
also the above commands do not work.The error says "unknown package ..."
Basically i am trying to develop a webserver which over the internet can be accessed to control hardware interfaced to BBB.
is there any way to solve this problem.I am using only usb connection to connect BBB using putty.
If you are using an Angstrom Distribution apache may not work. It freezes in between installation. Try upgrading to Ubuntu or Debian. Previous versions of BBB had very low memory (2GB) of which 1.5GB was taken by the OS. So try expanding it using a micro-SD card.
And it is a good practice to always update and upgrade your OS before installing any software.
sudo apt-get update && apt-get upgrade
I'm planning to use the following setup on EC2: PHP (recent version) plus memcached on an ec2 instance, and using Amazon's RDS service for the MySQL database.
Is there a recommended instance that has PHP and Memcached installed with the most often used php extensions? I am not much of a sysadmin and would prefer one that is already configured.
I don't know of any image that comes only with LAMP and memcached - but I setup something a while back - on a Amazon Linux AMI (which is a cut down centOS distro). You can always use this as a guide and set it up yourself (and create your own image afterwards).
DISCLAIMER: I'm doing this off memory- I might have missed a step or two here so read the error messages and figure out what is missing.
Install Apache, PHP, mySQL:
yum -y install httpd php mysql mysql-server php-mysql
Make sure this services start when you start your instances:
chkconfig httpd on
chkconfig –add mysqld
chkconfig mysqld on
Start apache and mySQL:
service httpd start
service mysqld start
Login to mysql and setup a root account. Create your DBs, setup users, remove test db etc.
Before we install memcached, you need to add EPEL repo to yum for extra centOS packages and then install some dependencies:
Create a new file /etc/yum.repos.d/epel.repo and paste:
[epel]
name=Extra Packages for Enterprise Linux 5 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/5/$basearch
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=0
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 5 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/5/$basearch/debug
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-5&arch=$basearch
failovermethod=priority
enabled=0
gpgcheck=0
[epel-source]
name=Extra Packages for Enterprise Linux 5 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/5/SRPMS
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-source-5&arch=$basearch
failovermethod=priority
enabled=0
gpgcheck=0
Install dependencies:
yum groupinstall "Development Tools"
yum install openssl-devel openssl
Now try installing memcached:
yum install memcached
Hope it helps