Skip to content

fix: add mod_php8 IfModule block to .htaccess#41612

Merged
DeepDiver1975 merged 1 commit into
masterfrom
fix/add-mod-php8-htaccess
Jun 10, 2026
Merged

fix: add mod_php8 IfModule block to .htaccess#41612
DeepDiver1975 merged 1 commit into
masterfrom
fix/add-mod-php8-htaccess

Conversation

@DeepDiver1975

Copy link
Copy Markdown
Member

Summary

PHP 8 registers its Apache module as mod_php8.c, not mod_php7.c. The existing .htaccess only has <IfModule mod_php5.c> and <IfModule mod_php7.c> blocks, so on PHP 8 installs all php_value directives (upload limits, memory limit, charset, output buffering) are silently ignored.

This PR adds a <IfModule mod_php8.c> block mirroring the mod_php7.c block, with one intentional omission: mbstring.func_overload was removed in PHP 8.0 and must not appear in the PHP 8 block.

Changes

  • .htaccess: new <IfModule mod_php8.c> block added after the mod_php7.c block, without mbstring.func_overload

Related

Raised in context of #41611 (big file upload configuration / Docker PHP 8 support).

@update-docs

update-docs Bot commented Jun 9, 2026

Copy link
Copy Markdown

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@mmattel

mmattel commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Q: why not removing the outdated other directives? (and moving the block to the bottom?)

@DeepDiver1975 DeepDiver1975 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds a <IfModule mod_php8.c> block to .htaccess and removes the now-obsolete mod_php5.c and mod_php7.c blocks.

The fix is correct and the omissions are intentional and well-explained:

  • mbstring.func_overload removed in PHP 8.0 — correctly absent from the new block.
  • always_populate_raw_post_data was PHP 5 only — correctly absent.
  • php_value default_charset and output_buffering are retained — correct.

One thing to verify: mod_php7.c being removed means PHP 7.x installations will silently fall back to compiled-in defaults for upload_max_filesize, post_max_size, memory_limit, etc. If the project still supports PHP 7.4 (Ubuntu 22.04 Docker image does), consider retaining the mod_php7.c block rather than replacing it. The companion PR owncloud-docker/base#472 adds these values to the PHP ini for the Docker image, which covers the Docker case — but bare (non-Docker) PHP 7.x installs relying on .htaccess would regress.

If PHP 7.x is no longer a supported target for this .htaccess, the removal is fine and this is ready to merge.

@phil-davis phil-davis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this have a changelog?

fix: remove obsolete mod_php5 and mod_php7 IfModule blocks
@DeepDiver1975 DeepDiver1975 force-pushed the fix/add-mod-php8-htaccess branch from 79c95d4 to c44c1ba Compare June 10, 2026 08:13
@DeepDiver1975 DeepDiver1975 merged commit a43e3e8 into master Jun 10, 2026
26 checks passed
@DeepDiver1975 DeepDiver1975 deleted the fix/add-mod-php8-htaccess branch June 10, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants