Solving the “Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database” error in Nextcloud

Once upon a time after installing Nextcloud on Ubuntu Server, I noticed an error:

Continue reading “Solving the “Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database” error in Nextcloud”

Solution “Internal Server Error” when opening Nextcloud

Recently moved Nextcloud from one server to another and when it opened, noticed the following error in the browser:

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

In my case, the error occurred because of a damaged MySQL database, so I restored it from another backup and Nextcloud opened.
I assume that the same error can occur when the Nextcloud database exists, but is empty.

See my article:
Install Nextcloud in Ubuntu

Installing and configuring ownCloud

ownCloud – Web application for synchronization, sharing and remote storage of data in the “cloud”.

Perform the installation of ownCloud for example in Ubuntu:

sudo apt-get install owncloud

I noticed that in Ubuntu, at the time of installation I tested on Ubuntu 14.04.03 LTS, canceled the installation of ownCloud from the repository, so you can add a third party and install or update from it. We look at the sources https://software.opensuse.org/package/owncloud

On Ubuntu 14.04, for example, installation from a third-party repository is performed by the following commands:

sudo sh -c "echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/xUbuntu_14.04/ /' >> /etc/apt/sources.list.d/owncloud.list"
sudo apt-get update
sudo apt-get install owncloud

The next step is to open the web interface http://server/owncloud in the browser and create the login and password for the administrator account, as well as specify the type of database to store the settings, accounts and other information owncloud.
For better performance, it’s better to use the mysql database, for this we will install the MySQL server and create it:

sudo apt-get install mysql-server
mysql -u root -p
create database owncloud;
grant all privileges on owncloud.* to owncloud@localhost  identified by 'ПАРОЛЬ';
exit

To be able to upload large files into owncloud, you will need to edit /etc/php5/apache2/php.ini by changing the upload_max_filesize and post_max_size in it, for example to 2048mb.

See also:
Install Nextcloud in Ubuntu