Nextcloud not connecting to Redis - php

On a Nextcloud install I am receiving the error
No memory cache has been configured. To enhance performance, please configure a memcache, if available. Further information can be found in the documentation.
So I have installed APCu, Redis, redis-php and made the required settings in NCs config.php
'memcache.local' => '\OC\Memcache\APCu',
'memcache.locking' => '\OC\Memcache\Redis',
'memcache.distributed' => '\OC\Memcache\Redis',
'filelocking.enabled' => 'true',
'redis' =>
array (
'host' => '127.0.0.1',
'port' => '6379',
When I test the redis connection
redis-cli ping
I get a
PONG
(This works both w/ localhost and unix socket)
But Nextcloud obviously does not connect to Redis.
The http user is a member of the redis group.
php-redis module is activated.

Solved. The issue was with the location of the above code inside Nextcloud's config.php.
Now it is working as expected.

Related

Install OwnCloud with PostgreSQL - Not Authenticating on Ubuntu 12.04LTS

Okay all I have tried to follow the instructions online for getting Postgresql to work with OwnCloud install but it still gives me the dreaded "PostgreSQL username and/or password not valid You need to enter either an existing account or the administrator."
I have installed:
Ubuntu 12.04LTS
Apache 2.2
PHP 5.3
PostgreSql 9.3
OwnCloud 6.0.3
My web server is hosted on an internal server at 192.168.1.11 and I have Postgresql running on port 3145.
Any tips on getting this to work with Postgresql... Here is my config.php file:
$CONFIG = array (
'instanceid' => 'oc57c67b8ac3',
'passwordsalt' => '07b04cab4ff3d074dc59fc3ef82650',
'trusted_domains' =>
array (
0 => 'www.example.com',
),
'datadirectory' => '/Cloud/owncloud/data',
'dbtype' => 'pgsql',
'version' => '6.0.3.1',
'dbname' => 'owncloud',
'dbuser' => 'cloudadm',
'dbpassword' => 'mypassword',
'dbhost' => '192.168.1.11:3145',
'dbtableprefix' => 'oc_',
);
Per #RandolphCarter -- when I upgraded to OwnCloud7.0 I was able to use the wizard, select the PostgreSQL option and enter [serverip]:[Postgresql port number] - e.g. -- 192.1.1.1:1118 and it worked with no problems. This is closed.
For some reason setup wizard searching localhost and found no IPv6 record in my pg_hba.conf After add this record it works.
host all all ::1/128 md5
or remove ::1 from /etc/hosts should be the same.
::1 localhost

Check if memcached is installed?

I used this guide to install memcached on Centos 6.5
I first checked
/etc/init.d/memcached status and
memcached (pid 14784) is running...
Then restarted
service httpd restart
But when I try to use memcached on software(prosper202) I get
Fatal error: Call to a member function getCapabilities() on a non-object in /var/zpanel/hostdata/zadmin/public_html/******_com/3rd-parties/wurfl/WURFL/CustomDeviceRepository.php on line 72
I don't know whats causing it.
Here is my WURFL configuration file
<?php
include($_SERVER['DOCUMENT_ROOT'] . '/202-config.php');
$configuration = array(
// WURFL File Configuration
'wurfl' => array(
'main-file' => 'wurfl.zip',
'patches' => array("web_browsers_patch.xml"),
),
// Persistence (Long-Term Storage) Configuration
'persistence' => array(
'provider' => 'mysql',
'params' => array('host'=>$dbhost,
'port'=>3306,
'db'=>$dbname,
'user'=>$dbuser,
'pass'=>$dbpass),
),
// Cache (Short-Term Storage) Configuration
'cache' => array(
'provider' => 'memcache',
'params' => 'host='.$mchost.',port=11211,namespace=wurfl',
),
);
Aha! Your issue is not with your installation of memcached. Keep in mind that memcache and memcached are two different caching mechanisms.
You'll want to make sure that your server has memcache or apc installed for WURFL to be able to cache properly.
Type the following to see if memcached exists:
which memcached
Check the memcached version:
memcached -h

using yii with memcache, error when one of two server fails

i have a problem with yii and storing data in memcache. For my application i use system.caching.CMemCache and the following config:
'servers' => array(
'server1' => array('host' => 'localhost', 'port' => 11211, 'weight' => 50),
'server2' => array('host' => '192.168.0.2', 'port' => 11211, 'weight' => 50)
),
if memcache on both systems is running, everything is ok and the values get spread up on the servers. but if one server fails (or if i stop the memcache manually) the application throw errors like
MemcachePool::get(): Server 192.168.0.2 (tcp 11211, udp 0) failed with: Connection refused (111)
this isn't really nice, i thought if one server failed yii would choose another server for reading and writing or at least produce some cache misses and do not throw an exeption :(
is this normal or are there some configuration issues?
I think its normal you are seeing those messages as discussed here, given you are using memcache extension
And also read this SO.
There are two version of extension for php one is memcache while the other is memcached. You can install each of them on ubuntu box like :
sudo apt-get install php5-memcache
and
sudo apt-get install php5-memcached
Memecached extension handles failover situations ,as I read from the above links and confirm by testing following settings in yii
'cache'=>array(
'class'=>'CMemCache',
'useMemcached'=>true,
'servers'=>array(
array(
'host'=>'localhost',
'port'=>11211,
'weight'=>60,
),
array(
'host'=>'192.168.33.31',
'port'=>11211,
'weight'=>30,
),
),
),
Install the memcached extension for php as described above and add 'useMemcached'=>true, setting to cache configs.As I test on my localhost, it handles the failover situation, but the page response time drops significantly.
Hope this will be helpful.
Is this variable true?
http://www.php.net/manual/en/memcache.ini.php#ini.memcache.allow-failover
Otherwise this link can also be useful:
Memcache : Confusions
(Probably this is only a notice.)

Install of laravel 4 from pagodabox breaks on localhost

How do I get laravel to work on local host from pagodabox? I've installed laravel 4 through pagoda box, then cloned it to localhost. I then ran composer install to get all the dependencies and updates. When I try to navigate the URI to the public directory, it doesn't show me a "you have arrived" screen. Instead I get the following error message:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. [tcp://tunnel.pagodabox.com:6379]
I then looked in "database.php" and noticed that the redis array was modified, so I copied the same one from a fresh installation of Laravel, but then I got the following error:
No connection could be made because the target machine actively refused it. [tcp://127.0.0.1:6379]
I Had the same problem, just change the bootstrap > start.php file, search for
'local' => array('your-machine-name')
and change it with your machine name.
This video help me to deal with that: http://www.youtube.com/watch?v=CJoU-LO8Ufo , in the video he changes it to the virtual host but that didn't work for me, i had to put my computer name.
On Mac the computer name can be found by typing hostname in the terminal.
Joshdcid's answer is right for some, but not all. I found this in my bootstrap > start.php file:
'local' => array('homestead')
..., and changing that variable in any way caused my laravel app to not load at all. Not only that, but in a fresh install of laravel, this local variable had the same value of 'homestead'.
After spending a bit of time in WinMerge, I found that you should use Wayne's tip of changing
'redis' => array(
'cluster' => false,
'default' => array(
'host' => 'tunnel.pagodabox.com',
'port' => 6379,
'database' => 0,
),
),
to
'redis' => array(
'cluster' => false,
'default' => array(
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0,
),
),
at the bottom of the app > config > database.php file, then you should also go to the top of the
app > config > session.php file and change
'driver' => 'redis',
to
'driver' => 'file',
..., just as a fresh install would have. You should be able to view your app now!

Cannot connect to PgSQL via Laravel SQLSTATE[08006] [7] FATAL

I'm trying to connect to pgsql via laravel and finally got everything setup (pgsql server running, pdo installed, all libs installed). I'm running on a VPS (CentOS) managed via CPanel/WHM.
Here's what I'm doing:
I'm trying to create a user database via artisan (Laravel's command line) using migrate:install.
For those that don't use Laravel, artisan uses php's PDO for pgsql to connect. Here are my settings:
'pgsql' => array(
'driver' => 'pgsql',
'host' => 'localhost',
'database' => 'dbname',
'username' => 'username',
'password' => 'password',
'charset' => 'utf8',
'prefix' => '',
),
I've also setup a test.php file:
$dbconn = pg_connect("host=localhost port=5432 dbname=dbname user=username password=password");
which also fails. I used phpPgAdmin to see what's up and all of the permissions are set correctly, the database shows up, the username is correct, same with password. I checked where postgre (version 8.4.12 btw) was running and phpPgAdmin tells me "localhost:5432".
The error I get via the command line is the following:
SQLSTATE[08006] [7] FATAL: no pg_hba.conf entry for host "::1", user "myusername", database "my_database", SSL OFF
Now, I tried to find the pg_hba.conf file but I'm not entirely sure where to look for it. Same goes for the error/access logs for pg and google hasn't been any help as far as this goes.
Any idea on what I can do?
localhost points to IPV6 ::1 address on your system. Postgresql makes the difference between ipv6 and ipv4 addresses when dealing with access list.
I was able to install/configure everything correctly. I changed the "host" to 127.0.0.1, not sure why that made a difference but it did :)

Categories