Fix “PHP Memory Limit Below Recommended Value” in ownCloud 10

The result you want is not merely “the warning disappeared.” A correct fix means the PHP process that actually serves ownCloud 10 reports a memory limit of at least 512 MB, the ownCloud admin warning clears, scheduled or CLI jobs use an appropriate limit too, and the host still has enough physical memory to run PHP, the web server, the database, and background jobs without heavy swapping.

For ownCloud Classic 10.16, the official Docker environment uses OWNCLOUD_MEMORY_LIMIT=512M as its recommended default. ownCloud's documentation also distinguishes the PHP configuration used by the web server from the one used by php-cli. That distinction is the main reason administrators sometimes change memory_limit, restart a service, and still see the same warning.

This guide starts with the least disruptive checks, then shows Apache, PHP-FPM, CLI, and Docker paths. It also explains when increasing the limit further is justified and when the real problem is insufficient host RAM rather than the PHP setting itself.

What success looks like

CheckGood resultIf it fails
ownCloud admin overviewNo “PHP memory limit below recommended value” warningYou probably edited the wrong PHP configuration or did not restart the correct service.
Web PHP runtimememory_limit shows 512M or higherFind the Loaded Configuration File used by the web request.
CLI / cron runtimephp -r 'echo ini_get("memory_limit");' shows the intended valueEdit the CLI-specific php.ini as well.
Host memoryEnough available RAM; little or no sustained swap pressureDo not keep increasing PHP limits blindly. Revisit PHP worker counts or host sizing.
LogsNo recurring “Allowed memory size exhausted” errorsFind the workload consuming memory before raising the limit again.

1. Confirm the warning and the value ownCloud sees

ownCloud 10 administrator overview showing a warning that the PHP memory limit is below the recommended value and a 128 MB limit
Start from the value visible to ownCloud itself. A 128 MB or 256 MB web-runtime limit is below the 512 MB value used by ownCloud's recommended Docker configuration.

Open the ownCloud administration settings and note the memory-limit warning. Before changing anything, record the ownCloud version, PHP version, web server type, and current memory limit. This gives you a baseline and helps prevent changing the wrong PHP installation on systems with multiple PHP versions.

ownCloud's current 10.16 documentation says server requirements depend heavily on user count, file count, and activity. Its Docker configuration sets OWNCLOUD_MEMORY_LIMIT=512M and recommends keeping that default. This makes 512 MB a sensible baseline for resolving the warning, not a guarantee that every workload will fit within 512 MB.

Official references: ownCloud deployment recommendations and ownCloud Docker environment variables.

2. Do not trust the CLI value to represent the web server

Ubuntu terminal showing php -i and php --ini with a 128M CLI memory limit and the CLI php.ini path
php --ini reports the configuration for PHP CLI. That can differ from the PHP configuration used by Apache or PHP-FPM to serve ownCloud.

Run these commands to see what the command-line PHP process uses:

php --ini
php -r 'echo ini_get("memory_limit"), PHP_EOL;'

This is useful for occ and cron jobs, but it is not proof of what the web request uses. ownCloud explicitly documents separate configuration paths such as:

/etc/php/<version>/apache2/php.ini
/etc/php/<version>/fpm/php.ini
/etc/php/<version>/cli/php.ini

If your CLI says 512M while the admin page still complains, that mismatch is a strong sign that the web server is loading another php.ini.

See ownCloud's PHP configuration notes, which specifically warn that PHP settings may need to be changed in more than one INI file.

3. Find the PHP configuration used by the web request

Browser phpinfo page showing the loaded PHP-FPM configuration file and a 128M memory_limit beside a terminal showing the CLI configuration
Compare the browser PHP runtime with the CLI runtime. The Loaded Configuration File in the browser is the file that matters for the ownCloud web warning.

The most reliable test is to inspect PHP from the same web stack that serves ownCloud. ownCloud's documentation describes using a temporary phpinfo.php page:

<?php phpinfo(); ?>

Place it temporarily in the web root, open it in a browser, and locate:

  • Loaded Configuration File
  • memory_limit
  • Server API

Then delete the phpinfo file immediately. ownCloud warns that leaving a public phpinfo page exposes sensitive server information.

If the browser says /etc/php/7.4/fpm/php.ini while php --ini says /etc/php/7.4/cli/php.ini, you now know exactly why editing the CLI file did not clear the warning.

4. PHP-FPM: raise the web-runtime limit to 512M

Nano editor open on a PHP-FPM php.ini file with memory_limit set to 512M
For an Nginx or Apache setup using PHP-FPM, change the FPM php.ini or the applicable pool/site override, not only the CLI file.

On a typical Debian or Ubuntu installation:

sudo nano /etc/php/7.4/fpm/php.ini

Find:

memory_limit = 128M

and change it to:

memory_limit = 512M

Use your installed PHP version in the path. Then restart the correct FPM service and your web server if needed:

sudo systemctl restart php7.4-fpm
sudo systemctl reload nginx

For Apache with proxy_fcgi or another FPM setup, restart PHP-FPM and reload Apache instead.

ownCloud also notes that PHP-FPM does not consume PHP settings from .htaccess. If you rely on per-directory overrides with FPM, use the supported PHP/FPM configuration mechanism for your environment, such as the appropriate php.ini, pool configuration, or .user.ini.

5. Apache with mod_php: edit the Apache PHP configuration

Nano editor showing memory_limit set to 512M in the Apache php.ini followed by an Apache restart command
With Apache mod_php, edit the Apache-specific PHP configuration and restart Apache so new worker processes load the new limit.

If Apache loads PHP directly as a module, edit the Apache-specific file:

sudo nano /etc/php/7.4/apache2/php.ini

Set:

memory_limit = 512M

Then restart Apache:

sudo systemctl restart apache2

Do not copy the version number mechanically. Check the version actually loaded by Apache. Systems upgraded across several PHP releases often retain multiple directories under /etc/php/.

The result criterion is simple: after the restart, the web-facing PHP runtime must show the new value. If it still shows 128M, another configuration layer is overriding your edit.

6. Update the CLI limit when occ or cron uses too little memory

The admin web warning is driven by the web runtime, but occ and cron jobs use PHP CLI. ownCloud's documentation calls this out explicitly.

Edit:

sudo nano /etc/php/7.4/cli/php.ini

Set:

memory_limit = 512M

Then verify:

php -r 'echo ini_get("memory_limit"), PHP_EOL;'

You do not need to restart a service for CLI PHP, because each CLI invocation starts a new process. But if your cron job explicitly calls another PHP binary, verify that exact binary rather than assuming /usr/bin/php is the one being used.

ownCloud recommends running occ as the HTTP user, typically www-data on Debian/Ubuntu. Its official occ documentation also warns that occ should use the same PHP version as the web server when multiple versions are installed.

7. Docker: use OWNCLOUD_MEMORY_LIMIT instead of editing files inside the container

Docker Compose file showing OWNCLOUD_MEMORY_LIMIT set to 512M and the ownCloud container being recreated
For the official ownCloud container, set OWNCLOUD_MEMORY_LIMIT=512M in the container environment and recreate the service so the generated PHP configuration is updated.

For the official ownCloud Docker image, use the documented environment variable:

environment:
  OWNCLOUD_MEMORY_LIMIT: 512M

Then recreate the service:

docker compose up -d

Do not make the primary fix by editing php.ini inside an ephemeral container. Container recreation can discard those changes. The official ownCloud Docker environment documentation defines OWNCLOUD_MEMORY_LIMIT=512M and recommends keeping that default.

If the Docker host itself has a tight memory limit, also inspect container constraints:

docker stats

A PHP limit of 512M does not magically give the container 512 MB of free memory; it only allows an individual PHP request to consume up to that amount. The container and host still need enough memory for all simultaneous PHP workers and other services.

8. Restart the correct service and verify from the same runtime

Terminal restarting PHP-FPM and Nginx and an ownCloud overview showing the PHP memory limit at 512 MB with checks passing
The fix is complete only when the web runtime reports 512M or more and ownCloud no longer shows the low-memory warning.

After restarting the relevant service, re-check the temporary phpinfo page or the ownCloud admin overview. Then remove the phpinfo page.

If you changed PHP-FPM, check:

sudo systemctl status php7.4-fpm
sudo systemctl status nginx

If you changed Apache:

sudo systemctl status apache2

Refresh the ownCloud admin page. The warning should be gone if ownCloud is now executing with at least the expected limit.

9. Check host RAM before raising the PHP limit beyond 512M

Ubuntu terminal showing free memory, PHP-FPM worker processes, and recent ownCloud log entries
After raising the per-request limit, check total system memory and PHP worker behavior. A higher PHP ceiling can increase worst-case RAM consumption when many workers are active.

Run:

free -h
ps aux | grep php-fpm
vmstat 1

The PHP memory_limit is a per-script ceiling. It is not a reservation and it is not the same as the amount of RAM the server needs. If you have 20 PHP workers and give every request permission to use a very large amount of memory, the theoretical worst case can exceed the machine's RAM by a wide margin.

ownCloud's tuning documentation gives the same general warning for web-server processes: size the number of processes so aggregate memory use stays below available RAM, otherwise the system starts swapping and performance falls. See ownCloud Classic tuning guidance.

If the 512M warning is gone and ordinary operations are healthy, there is no reason to increase the limit just to make the number larger.

10. When 512M still produces “Allowed memory size exhausted”

A cleared recommendation warning and a memory-exhaustion crash are different issues. If the logs contain messages such as:

PHP Fatal error: Allowed memory size of ... bytes exhausted

identify the operation that triggers it. Large scans, encryption jobs, external-storage operations, image processing, or a third-party app can have very different memory profiles.

Check ownCloud's log and the PHP/web-server error log. A standard ownCloud installation writes its own log under the configured data directory, commonly data/owncloud.log. Avoid treating “increase it to 1G” as the automatic next step. First establish whether the same operation repeatedly reaches the ceiling.

If one known administrative job legitimately needs more memory, a targeted CLI override can be safer than globally giving every web request a huge limit:

php -d memory_limit=1G occ <command>

Use this only when the command and memory behavior are understood. It does not fix a web request that runs through PHP-FPM or Apache.

Why the warning may remain after editing php.ini

SymptomLikely causeNext check
php -r shows 512M, ownCloud still shows 128MYou changed CLI PHP onlyCheck browser phpinfo and its Loaded Configuration File.
FPM file says 512M, browser still shows 128MPool, .user.ini, or another INI file overrides itInspect phpinfo “local” and “master” values and additional parsed INI files.
Value changes only after rebootCorrect service was not restartedRestart PHP-FPM or Apache explicitly after the edit.
Docker value returns to old setting after recreateYou edited inside the containerSet OWNCLOUD_MEMORY_LIMIT in Compose or the deployment environment.
Warning disappears but server begins swappingPHP concurrency exceeds host memoryReduce worker count, optimize workload, or add RAM.

Do not confuse memory_limit with upload limits

memory_limit, upload_max_filesize, and post_max_size solve different problems. Raising PHP memory does not automatically let users upload larger files. ownCloud's 10.16 configuration notes separately state that post_max_size should be configured to at least 512 MB for the documented minimum and explain that upload limits need their own settings.

If the actual symptom is “large uploads fail,” inspect upload_max_filesize, post_max_size, proxy/web-server body-size limits, timeouts, and temporary-disk capacity. Do not use a higher memory_limit as a substitute for those controls.

Final checklist

  • Confirm the warning and current value in ownCloud.
  • Identify whether ownCloud uses Apache mod_php or PHP-FPM.
  • Find the web runtime's Loaded Configuration File.
  • Set the web PHP memory_limit to at least 512M.
  • Update CLI PHP too if occ or cron uses a lower limit.
  • For Docker, set OWNCLOUD_MEMORY_LIMIT=512M in the deployment environment.
  • Restart or recreate the service that actually serves PHP.
  • Verify the value from the web runtime, not only from CLI.
  • Confirm the ownCloud warning is gone.
  • Monitor host RAM and swap before increasing the limit beyond 512M.

Bottom line

The clean fix for “PHP memory limit below recommended value” in ownCloud 10 is to make the PHP runtime that actually serves ownCloud use a 512 MB or higher limit, then verify that result from the same runtime. The most common failure is editing /etc/php/.../cli/php.ini while ownCloud is running through PHP-FPM or Apache with a different configuration file.

Stop once the warning is gone, routine operations are healthy, and the host has comfortable memory headroom. If PHP still exhausts 512 MB during a specific operation, switch from “raise the number” to workload diagnosis: inspect the failing command, apps, logs, concurrency, and physical RAM. A larger limit can be appropriate, but only when the workload justifies it and the server can safely support it.

Leave a Comment

7 Best WSUS Tools for Update Management and Troubleshooting

7 Best WSUS Tools for Update Management and Troubleshooting

Compare seven tools that support or complement WSUS, from Microsoft’s native console and diagnostics to third-party patch publishing and remote deployment.

Best Windows System Monitoring Tools: 6 Picks for Server Visibility

Best Windows System Monitoring Tools: 6 Picks for Server Visibility

Compare six Windows system monitoring tools for server health, application visibility, and alerting, with current notes on deployment and licensing.

7 Wake-on-LAN Tools: What’s Still Available From the 2021 List

7 Wake-on-LAN Tools: What’s Still Available From the 2021 List

Compare seven Wake-on-LAN tools by features and availability, including free utilities, network-admin suites, and 2021 picks that have since been retired.

9 Best Ping Tools for Testing Latency and Scanning a Network

9 Best Ping Tools for Testing Latency and Scanning a Network

Compare nine ping tools for quick reachability checks, subnet discovery, TCP tests, and latency monitoring, with guidance on which one fits your network task.

Best TFTP Servers for Windows, Linux, and macOS

Best TFTP Servers for Windows, Linux, and macOS

Compare the best TFTP servers for Windows, Linux, and macOS, including SolarWinds, Tftpd64, tftpd-hpa, atftpd, haneWIN, and dnsmasq.

5 Best Microsoft Access Alternatives for Desktop and Web Databases

5 Best Microsoft Access Alternatives for Desktop and Web Databases

Compare five Microsoft Access alternatives for desktop, SQLite, no-code, and browser-based database work, with strengths, limits, and best-fit use cases.

Open-Source vs. Closed-Source Monitoring Tools Compared

Open-Source vs. Closed-Source Monitoring Tools Compared

Compare open-source and closed-source monitoring tools by cost, support, customization, security, and current options including Zabbix, Nagios, PRTG, and more.

Ingress vs. Egress: What’s the Difference in Networking?

Ingress vs. Egress: What’s the Difference in Networking?

Understand how ingress and egress describe incoming and outgoing traffic, why direction depends on the network boundary, and how to monitor bandwidth and spot risky data transfers.

6 Best Free Syslog Servers to Try for Centralized Logging

6 Best Free Syslog Servers to Try for Centralized Logging

Compare six free syslog servers and collectors for Windows and Linux, including GUI tools, open-source options, search, alerting, and secure transport.

What Is IIS? Microsoft’s Windows Web Server and Alternatives

What Is IIS? Microsoft’s Windows Web Server and Alternatives

See what Microsoft IIS does, how its request pipeline and application pools work, and when Apache, NGINX, or Caddy may fit your web server needs better.