nextcloud / nextcloud/documentation

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

Open Beginner friendly
#4,758 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop bug feature: install and update good first issue manual: admin
Dominant language
JavaScript
Stars
628
Forks
2.5k
Avg merge
2d 11h
Merged PRs (30d)
135

Description

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

https://github.com/nextcloud/documentation/issues/571

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Edit admin_manual/configuration_database/linux_database_configuration.rst around lines 101-120, and compare the current PHP 7.2+ requirements with the linked PHP manual pages. Remove or replace the obsolete MySQL (Original) configuration guidance with applicable mysqlnd and PDO_MYSQL information. Done means the example no longer documents removed PHP functionality and accurately reflects Nextcloud's PDO-based MySQL setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, php
Domain
databases, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
Half a day
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.