## Source

<https://docs.nextcloud.com/server/latest/admin_manual/installation/php_configuration.html>

## PHP Modules

This section lists all required and optional PHP modules. Consult the
[PHP manual](https://php.net/manual/en/extensions.php) for more information on modules.
You can check the presence of a module by typing `php -m | grep -i <module_name>`.
If you get a result, the module is present.

Required:

- PHP
- PHP module ctype
- PHP module curl
- PHP module dom
- PHP module fileinfo (included with PHP)
- PHP module filter (only on Mageia and FreeBSD)
- PHP module GD
- PHP module hash (only on FreeBSD)
- PHP module JSON (included with PHP >= 8.0)
- PHP module libxml (Linux package libsml2 must be >=2.7.0)
- PHP module mbstring
- PHP module openssl (included with PHP >=8.0)
- PHP module posix
- PHP module session
- PHP module SimpleXML
- PHP module XMLReader
- PHP module XMLWriter
- PHP module zip
- PHP module zlib

Database connectors

- PHP module pdo_mysql (MySQL/MariaDB)

_Recommended_ packages:

- PHP module intl (increases language translation performance and fixes sorting of non-ASCII characters)
- PHP module sodium (for Argon2 for password hashing, bcrypt is used as fallback,
  but if passwords were hashed with Argon2 already and the module is missing, your users can't log in.)

Required for specific apps:

...

For preview generation (_optional_):

- PHP module imagick
- avconv or ffmpeg
- OpenOffice or LibreOffice

For command line updater (_optional_):

- PHP module phar (upgrades Nextcloud by running `sudo -u www-data php /var/www/nextcloud/updater/updater.phar`)

## ini values

The following ini settings should be adapted if needed for Nextcloud:

- `apc.enable_cli`: see [Memory caching](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/caching_configuration.html)
- `disable_funcitons`: avoid disabling functions unless you know exactly what you are doing
- `max_execution_time`: see [Uploading big files](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/big_file_upload_configuration.html)
- `memory_limit`: should be at least 512MB. See also [Uploading big files](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/big_file_upload_configuration.html)
- `opcache.enable` and friends: See [Memory caching](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/caching_configuration.html) and [Server tuning](https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html)
- `open_basedir`: see [Hardening and security](https://docs.nextcloud.com/server/latest/admin_manual/installation/harden_server.html)
- `upload_tmp_dir`: see [Uploading big files](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/big_file_upload_configuration.html)

## php.ini configuration notes

Keep in mind that chagnes to `php.ini` may have to be configured on more than one ini file. This can be the case, for example, for the `date.timezone` setting. You can search for a parameter with the following command: `grep -r date.timezone /etc/php`.

### php.ini used by the Web server:

```apache2
/etc/php/8.0/apache2/php.in
or
/etc/php/8.0/fpm/php.ini
or ...
```

### php.ini used by the php-cli ans so by Nextcloud CRON jobs:

```
/etc/php/8.0/cli/php.ini
```
