From 3fc0b29d886954f20f2e85f5c53155402f4df4ea Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Fri, 30 Jan 2026 13:53:20 +0100 Subject: [PATCH] fix(koillection): override FrankenPHP runtime with Symfony runtime Koillection 1.8.0 configures FrankenPHP runtime in composer.json extra, but we use Apache. Fix by: - Adding APP_RUNTIME to .env.local for CLI commands - Adding SetEnv APP_RUNTIME in Apache VirtualHost for web requests - Creating uploads directory before chown - Update script checks and adds runtime config for upgrades --- ct/koillection.sh | 12 +++++++++++- install/koillection-install.sh | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ct/koillection.sh b/ct/koillection.sh index 5a11776ae..a743d58d3 100644 --- a/ct/koillection.sh +++ b/ct/koillection.sh @@ -44,8 +44,13 @@ function update_script() { cd /opt/koillection cp -r /opt/koillection-backup/.env.local /opt/koillection cp -r /opt/koillection-backup/public/uploads/. /opt/koillection/public/uploads/ + + # Ensure APP_RUNTIME is in .env.local for CLI commands (upgrades from older versions) + if ! grep -q "APP_RUNTIME" /opt/koillection/.env.local 2>/dev/null; then + echo 'APP_RUNTIME="Symfony\Component\Runtime\SymfonyRuntime"' >> /opt/koillection/.env.local + fi + export COMPOSER_ALLOW_SUPERUSER=1 - export APP_RUNTIME='Symfony\Component\Runtime\SymfonyRuntime' $STD composer install --no-dev -o --no-interaction --classmap-authoritative $STD php bin/console doctrine:migrations:migrate --no-interaction $STD php bin/console app:translations:dump @@ -55,6 +60,11 @@ function update_script() { mkdir -p /opt/koillection/public/uploads chown -R www-data:www-data /opt/koillection/public/uploads rm -r /opt/koillection-backup + + # Ensure APP_RUNTIME is set in Apache config (for upgrades from older versions) + if ! grep -q "APP_RUNTIME" /etc/apache2/sites-available/koillection.conf 2>/dev/null; then + sed -i '/> /opt/koillection/.env.local export COMPOSER_ALLOW_SUPERUSER=1 -export APP_RUNTIME='Symfony\Component\Runtime\SymfonyRuntime' $STD composer install --no-dev -o --no-interaction --classmap-authoritative $STD php bin/console doctrine:migrations:migrate --no-interaction $STD php bin/console app:translations:dump @@ -49,6 +49,7 @@ cat </etc/apache2/sites-available/koillection.conf ServerName koillection DocumentRoot /opt/koillection/public + SetEnv APP_RUNTIME "Symfony\\Component\\Runtime\\SymfonyRuntime" Options Indexes FollowSymLinks AllowOverride All