Nextcloud version (eg, 18.0.0): 18.0.0
Operating system and version (eg, Centos 17.04): CentOS Linux 7
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.6 (CentOS)
PHP version (eg, 7.1): PHP 7.3.14 (cli) (built: Jan 21 2020 09:59:50) ( NTS )
The issue you are facing:
Is this the first time you’ve seen this error? (Y/N):
Steps to replicate it:
Just try to click on url http://{ip}
The output of your Nextcloud log in Admin > Logging:
... in ...nextcloud.log
...
`"message":{"Exception":"Doctrine\\DBAL\\DBALException","Message":"Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2006] MySQL server has gone away"`
...
The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):
Thank you for your response. I followed your advice but unhappy by now:
[root@nextcloud ~]# grep "dbhost" /var/www/html/nextcloud/config/config.php
'dbhost' => 'localhost:/var/lib/mysql/mysql.sock',
[root@nextcloud ~]# ping localhost
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from nextcloud (127.0.0.1): icmp_seq=1 ttl=64 time=0.078 ms
64 bytes from nextcloud (127.0.0.1): icmp_seq=2 ttl=64 time=0.061 ms
^C
--- localhost ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.061/0.069/0.078/0.011 ms
[root@nextcloud ~]# ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.062 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.061 ms
^C
--- 127.0.0.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.061/0.061/0.062/0.007 ms
[root@nextcloud ~]# vim /var/www/html/nextcloud/config/config.php
The server was unable to complete your request.
If this happens again, please send the technical details below to the server administrator.
More details can be found in the server log.
### Technical details
* Remote Address: x.x.x.x
* Request ID: Xjxib@x-nIt-QLf89LoW4AAAAAE
* Type: Doctrine\DBAL\DBALException
* Code: 0
* Message: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2006] MySQL server has gone away
* File: /var/www/html/nextcloud/lib/private/DB/Connection.php
* Line: 68
Having both config.php and config.sample.php in the same directory is not an issue. Nextcloud will only use the config.php file for configuration parameters. Make sure the permissions are set properly on all of your files and folders though.
You have CAN_INSTALL file in your config directory. You should not have config.php file there at the same time. Config.php is created when you go to your Nextcloud page with a browser. Then it will ask your db info and creates tables etc. deletes can_install and creates config.php. After that you can edit it.
Move config.php somewhere else, just in case. (or delete) Then goto your Nextcloud. Let’s see what happens.
Thank you very much! It works!
Now after installation complete i have right config.php here:
[root@nextcloud ~]# ls /var/www/html/nextcloud/config/
config.php config.sample.php
[root@nextcloud ~]#