
In the original post I wrote that I've tried to change the location of Unix domain socket file, and I really did. Uncomment and modify unix_socket_directories parameter in /var/lib/pgsql/9.3/data/nf ( /tmp is still needed not to break psql and other programs): unix_socket_directories = '/tmp,/var/pgsql'Īnd here was another tricky part. # semanage fcontext -a -t httpd_var_run_t "/var/pgsql(/.*)?"

To resolve the issue I've changed the location for PostgreSQL Unix domain socket file with following steps:Ĭreate a new directory /var/pgsql (note changing SELinux file context): # mkdir /var/pgsql This means that php-fpm could not see /tmp/.s.PGSQL.5432 nor anything else located in /tmp. The initial cause of it was in systemd service file for php-fpm /usr/lib/systemd/system/rvice: 1 apache apache 0 Oct 31 19:54 /proc/882/root -> /Īt this point I have no more ideas where the problem can be and I would appreciate any help. It looks like php-fpm process is not chroot'ed: # ls -l /proc/882/root The file name is correct and, again, file /tmp/.s.PGSQL.5432 exists: $ ls -l /tmp/.s.PGSQL.5432 connect(5,, 110) = -1 ENOENT (No such file or directory) fcntl(5, F_SETFL, O_RDONLY|O_NONBLOCK) = 0 Relevant lines from strace of php-fpm: socket(PF_LOCAL, SOCK_STREAM, 0) = 5 There was nothing in /var/log/audit/audit.log, but I've tried to disable SELinux, just to be sure: # setenforce 0 Relevant line from /var/lib/pgsql/9.3/data/pg_hba.conf: local all username trustĬhange of location for Unix domain socket file in /var/lib/pgsql/9.3/data/nf did not help: unix_socket_directories = '/var/run/pgsql' So there should be no problems from the PostgreSQL side. Is the server running locally and acceptingĬonnections on Unix domain socket "/tmp/.s.PGSQL.5432"?įile /tmp/.s.PGSQL.5432 exists and I can connect using psql: $ psql -Uusername db_name PostgreSQL is listening on standard port 5432 and I have no problems to use it via TCP/IP at 127.0.0.1:5432, but when I try to connect to its Unix domain socket, I have a following error: Cannot connect to database: SQLSTATE could not connect to server: The server’s host name (db.server.I'm trying to connect to PostgreSQL Unix domain socket from a PHP web application. To check the server’s network availability, use the ping command on How can I find out if my MySQL/PostgreSQL server is reachable? Please refer to Configuration Parameters for an example. Systems Nextcloud is providing a dbdriveroptions configuration option within yourĬonfig/config.php where you can pass such options to the database driver. Some shared hosters are not allowing the access to these config options.
#Configure postgresql unix socket how to
Refer to the manual of your database for how to raise the configuration options

It’sĪlso possible that the server is dropping a packet that is too large. The database request takes too long and therefore the MySQL server times out. Troubleshooting How to work around “general error: 2006 MySQL server has gone away” Verify the transaction_isolation and binlog_format: The transaction isolation level is set to “READ-COMMITTED” in your MariaDB server configuration /etc/mysql/my.cnf to persist even after a restart of your database server. If you decide to use a MySQL or MariaDB database, ensure the following: Configuring a MySQL or MariaDB database However, in special cases (for example, if you want to connect your Nextcloud instance to a database created by a previous installation of Nextcloud), some modification might be required. You should not have to edit the respective values in the config/config.php. Many parallel operations) you need to configure the transaction isolation level accordingly.įor setting up Nextcloud to use any database, use the instructions in Installation wizard. by using the sync client with many clients/users and To avoidĭata loss under high load scenarios (e.g. Some database configurations are enforcing other transaction isolation levels. Database “READ COMMITTED” transaction isolation level Īs discussed above Nextcloud is using the TRANSACTION_READ_COMMITTED transaction isolation

Please refer to the documentation for your specificĭatabase choice for instructions. The steps for configuring a third party database are beyond the
