From 69facbaaaba4ab11601ead14f5e1f3e8a3073a81 Mon Sep 17 00:00:00 2001 From: skjnldsv Date: Thu, 23 Apr 2026 11:30:20 +0200 Subject: [PATCH 1/2] (occ command) Adds apc.enable_cli instructions The proper setup of apc.enable_cli is mentioned elsewhere in the manual (for cron and the updater), but not mentioned in the occ command section. Since this triggers an exception, let's help people solve the problem themselves. This resolves the recurring issue of users encountering APCu memcache errors when running occ commands. --- admin_manual/occ_command.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/admin_manual/occ_command.rst b/admin_manual/occ_command.rst index c5776bd1d3e..d04ff44fd3d 100644 --- a/admin_manual/occ_command.rst +++ b/admin_manual/occ_command.rst @@ -29,6 +29,16 @@ The HTTP user is different on the various Linux distributions: * The HTTP user and group in Arch Linux is http. * The HTTP user in openSUSE is wwwrun, and the HTTP group is www. +.. note:: + Since APCu is disabled by default for the command-line mode of PHP, it can cause issues with Nextcloud's ``occ`` command. Please make sure you set the ``apc.enable_cli`` parameter to ``1`` in your PHP CLI's ``php.ini`` configuration file or append ``--define apc.enable_cli=1`` each time you invoke ``occ`` - e.g.:: + + sudo -u www-data php --define apc.enable_cli=1 occ config:list system + + If you fail to do this, you will receive output such as the following:: + + An unhandled exception has been thrown: + OCP\\HintException: [0]: Memcache \\OC\\Memcache\\APCu not available for local cache (Is the matching PHP module installed and enabled?) + If your HTTP server is configured to use a different PHP version than the default (/usr/bin/php), ``occ`` should be run with the same version. For example, in CentOS 6.5 with SCL-PHP70 installed, the command looks like this:: From 4112f6a6bafd1f2fd05dfc9a06e1a8f63fa5a431 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Apr 2026 07:57:46 +0000 Subject: [PATCH 2/2] Fix RST formatting, grammar, and backslash escaping in APCu note Agent-Logs-Url: https://github.com/nextcloud/documentation/sessions/41851cf4-a798-4651-93af-ba7e4da5caab Co-authored-by: nextcloud-command <88102737+nextcloud-command@users.noreply.github.com> --- admin_manual/occ_command.rst | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/admin_manual/occ_command.rst b/admin_manual/occ_command.rst index d04ff44fd3d..efc7ef95522 100644 --- a/admin_manual/occ_command.rst +++ b/admin_manual/occ_command.rst @@ -29,15 +29,16 @@ The HTTP user is different on the various Linux distributions: * The HTTP user and group in Arch Linux is http. * The HTTP user in openSUSE is wwwrun, and the HTTP group is www. -.. note:: - Since APCu is disabled by default for the command-line mode of PHP, it can cause issues with Nextcloud's ``occ`` command. Please make sure you set the ``apc.enable_cli`` parameter to ``1`` in your PHP CLI's ``php.ini`` configuration file or append ``--define apc.enable_cli=1`` each time you invoke ``occ`` - e.g.:: +.. note:: - sudo -u www-data php --define apc.enable_cli=1 occ config:list system + APCu is disabled by default for the command-line mode of PHP, which can cause issues with Nextcloud's ``occ`` command. Please make sure you set the ``apc.enable_cli`` parameter to ``1`` in your PHP CLI's ``php.ini`` configuration file or append ``--define apc.enable_cli=1`` each time you invoke ``occ`` - e.g.:: - If you fail to do this, you will receive output such as the following:: + sudo -u www-data php --define apc.enable_cli=1 occ config:list system - An unhandled exception has been thrown: - OCP\\HintException: [0]: Memcache \\OC\\Memcache\\APCu not available for local cache (Is the matching PHP module installed and enabled?) + If you fail to do this, you will receive output such as the following:: + + An unhandled exception has been thrown: + OCP\HintException: [0]: Memcache \OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?) If your HTTP server is configured to use a different PHP version than the default (/usr/bin/php), ``occ`` should be run with the same version. For