The issue
I am encountering a 500 Internal Server Error after clearing the cache via the Flarum admin panel. This issue seems related to my PHP version settings.
Hosting Environment:
• Shared hosting with cPanel
• Using CloudLinux PHP Selector (alt-php82) because ea-php82 does not have the required PHP extensions
• PHP version can be changed via MultiPHP Manager or by modifying .htaccess
What happens:
• When using ea-php82:
• ✅ Clearing cache works fine.
• ❌ But some required PHP extensions are missing.
• When using alt-php82:
• ✅ Required PHP extensions are enabled.
• ❌ Clearing cache causes a 500 error.
• After clearing cache, the PHP version in MultiPHP Manager sometimes changes to ea-php81(default system php version) instead of staying on alt-php82.
Temporary Fix:
I manually switch the PHP version in MultiPHP Manager or .htaccess, refresh the site to regenerate cache, then switch back to alt-php82.
Additional Info:
• There are no error logs recorded in /storage/logs.
• Browser console does not show any relevant errors.
• The issue is only resolved after manually changing PHP versions.
My Question:
• What exactly happens when Flarum clears the cache?
• Could this process affect PHP settings, file permissions, or anything that might cause PHP version changes?
• Has anyone experienced a similar issue when using CloudLinux PHP Selector (alt-php82)?