Skip to content

The suggested configuration for PHP MySQL driver is wrong due to MySQL (Original) being removed since PHP 7.0 #4758

Description

@kroko

Issue

The docs about PHP MySQL driver configuration are so outdated they are wrong

https://docs.nextcloud.com/server/latest/admin_manual/configuration_database/linux_database_configuration.html#configuring-a-mysql-or-mariadb-database

https://github.com/nextcloud/documentation/blob/master/admin_manual/configuration_database/linux_database_configuration.rst#L101-L120

The PHP configuration in /etc/php7/conf.d/mysql.ini could look like this:

```ini
# configuration for PHP MySQL module
extension=pdo_mysql.so
[mysql]
mysql.allow_local_infile=On
mysql.allow_persistent=On
mysql.cache_size=2000
mysql.max_persistent=-1
mysql.max_links=-1
mysql.default_port=
mysql.default_socket=/var/lib/mysql/mysql.sock  # Debian squeeze: /var/run/mysqld/mysqld.sock
mysql.default_host=
mysql.default_user=
mysql.default_password=
mysql.connect_timeout=60
mysql.trace_mode=Off
```

The example shows runtime configuration for MySQL (Original) which is removed since PHP 7.0

This extension is deprecated as of PHP 5.5.0, and has been removed as of PHP 7.0.0. Instead, either the mysqli or PDO_MySQL extension should be used. See also the MySQL API Overview for further help while choosing a MySQL API.

Given that the required PHP runtime for Nextcloud is PHP 7.2+ the docs should not reflect any possible configuration applicable to PHP version lower than 7.

Proposed solution

1

At first the docs could just refer to applicable PHP.net entries, namely

; configuration for php mysql module
; priority=10
extension=mysqlnd.so

; https://www.php.net/manual/en/mysqlnd.config.php
; mysqlnd.collect_statistics=1
; mysqlnd.collect_memory_statistics=0
; mysqlnd.debug=
; mysqlnd.log_mask=0
; mysqlnd.mempool_default_size=16000
; mysqlnd.net_read_timeout=86400
; mysqlnd.net_cmd_buffer_size=4096
; mysqlnd.net_read_buffer_size=32768
; mysqlnd.sha256_server_public_key=
; mysqlnd.trace_alloc=
; mysqlnd.fetch_data_copy=0
; configuration for php mysql module
; priority=20
extension=pdo_mysql.so

; https://www.php.net/manual/en/ref.pdo-mysql.php
; pdo_mysql.default_socket=/run/mysqld/mysqld.sock
; pdo_mysql.debug=

Given that NC uses PDO MySQLi runtime configuration is not applicable.

2

Afterwards the docs can suggest mysqlnd and pdo_mysql values, if any.

Related

#571

Activity

  1. changed the title [-]The suggested configuration for PHP MySQL driver is wrong due to MySQL (Original) beeing removed since PHP 7.0[/-] [+]The suggested configuration for PHP MySQL driver is wrong due to MySQL (Original) being removed since PHP 7.0[/+] on Sep 16, 2020
  2. skjnldsv commented on May 14, 2026

    @skjnldsv
    Member

    Still present. admin_manual/configuration_database/linux_database_configuration.rst lines 107-126 show a [mysql] ini block (mysql.allow_local_infile, mysql.cache_size, etc.) from the original mysql PHP extension, which was removed in PHP 7.0. Nextcloud now requires PHP 8.0+, so this config is not just outdated but actively wrong.

    Fix: remove lines 107-126 (the [mysql] block and its heading) and replace with correct guidance for PDO_MySQL configuration. The reference to /etc/php7/conf.d/mysql.ini on line 107 should also be updated to a current path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions